Add Additional Languages (Localization)
If you are working with a fresh WEC Starter Package installation, begin by logging into the TYPO3 Backend.
If you are working with a website that is NOT a fresh install of the WEC Starter Package, you will need to complete the Add Additional Languages (Database Update) How To first.
- To add or change the language of a WEC TYPO3 website is a complex task and should only be attempted by a website administrator who has experience working with MySQL databases and TypoScript.
- Using the List Module, select the global root of your website (the page with globe icon in the Page Tree).
- Click on the Create new record icon and then select Website Language from the New record form.
- Complete the form with the Language name, the ISO code from the dropdown menu, and select the flag icon if desired. Save the record.
- Add additional records as needed by repeating the above steps.
- Be sure to take note of the language uid's (the unique identifier of the record) for later steps.
- You can find the UID of the language records by "hovering" your mouse over the record icons. Make note of which UID is associated with which language.
- Next, use the Ext Manager Module to import the sr_language_menu extension.
- Select Import extensitions from the dropdown Menu. Search ALL extensions for Language and then select the sr_language_menu extension from the list.
- Import and install the extension.
- Next, using the Template Module, select the root page of the website and use the Info/Modify tool from the dropdown menu to add the necessary TypoScript for language localization.
- Click on the Setup edit icon.
- Scroll down and find the Login Box TypoScript and add
lib.login.30 < temp.languageMenu
to the end of the Login Box TypoScript. - Next, add the following TypoScript ABOVE the Login Box TypoScript:
temp.languageMenu < plugin.tx_srlanguagemenu_pi1
temp.languageMenu.languagesUidsList = [language record uids, comma separated 1,2,4)
temp.languageMenu.defaultLayout = 1
where the languagesUidsList = the language record UIDs you noted earlier. - Next, scroll to the bottom of the Setup form and add the following TypoScript:
# Localization:
config {
linkVars = L
sys_language_mode = content_fallback
sys_language_overlay = hideNonTranslated
}
[globalVar = GP:L=1]
config {
sys_language_uid = 1
language = de
}
[globalVar = GP:L=2]
config {
sys_language_uid = 2
language = nl
}
[global]
where the GP:L= 1 reflects the language record UID, the sys_language_uid = 1 reflects the language record UID, and the lanugage = de reflects the utf8 language code.
- Scroll to the top of the page and click the Update button to save your work. Then using the Page Module, select the page you want to add an additional translated page.
- Click on the Localization view tab at the top of the page and then select the alternative language you want to provide from the Create new page translation dropdown menu.
- Complete the Alternative Page Language form and save it.
- Next, select the language page you want to edit from the Show page language version dropdown menu. Then add and edit whatever Content Elements you would like to. Then save your work and view it in the Frontend.
- You will notice that there is a language selection menu below the Login Box. Select the language you'd like to view from that menu.
- Repeat the Localization process for each additional translation you'd like to include.