Zum Inhalt springen

Multilingualism

By default, the sample project is prepared for two languages: German as the default language and English as the second language.

Customize standard language

The settings for the default language are made in the file fileadmin/jweilandnet_musterprojekt_62/Resources/Typoscript/config.ts:

## values for default language: German 
sys_language_uid = 0
language = de
locale_all = de_DE
htmlTag_langKey = de

Create additional languages

You can create additional languages via the backend on the root page "Sample project" (id = 0). You will need the ID of the new language in the further configuration in the Typoscript.

Other languages are configured in the file fileadmin/jweilandnet_musterprojekt_62/Resources/Typoscript/lib.multilanguage.ts

English is already predefined, a code block for an additional language is prepared.

You can store the ID of an additional language as a constant in the file fileadmin/jweilandnet_musterprojekt_62/Resources/Typoscript/lib.multilanguage.txt.

If you add another language, the configuration of the RealUrl extension must also be adapted.

To do this, open the file typo3conf/realurl_conf.php and search for the following section:

 array( 
'GETvar' => 'L',
'valueMap' => array(
'en' => '1',
'de' => '0'
),

Here you must add the additional language with the corresponding ID.

Example: additional language French, ID = 2

 array( 
'GETvar' => 'L',
'valueMap' => array(
'fr' =>'2',
'en' => '1',
'de' => '0'
),

Menu for language switching as text or flag variant

In the default setting, the menu for language switching is displayed as a text menu. A second variant is the display of country flags. When using this variant, however, there are a few things to consider and adjust.

The display type is controlled via the file lib.multilanguage.ts in the directory fileadmin/jweilandnet_musterprojekt/Resources/Typoscript.

To switch to flag display, you must comment the last code block in this file from line 63 with the characters /* and */ so that the block is inactive and is not executed.

Please note:

The flag menu is only prepared for the use of the German and English flags. If you want to use other or additional languages, you must adapt the graphic that is used to display the flags. You will find the graphic flagsprite.gif in the directory fileadmin/jweilandnet_musterprojekt/Resources/Images/

In addition, adjustments to the CSS in the file musterprojekt_style.css in the directory fileadmin/jweilandnet_musterprojekt/Resources/Css/ are also necessary.

We therefore recommend using the text version of the language switching menu, which is also active by default.

Deactivate multilingualism

If your website only uses one language, you can also deactivate multilingualism in the sample project.

Hide language menu

To deactivate the display of the language menu, go to the template backend module. Call up the root template on the "Home" page. Use the selection box at the top to switch to the "Info/Edit" view and then click on "Constants"

Then set the constant langMenu = 0 here.

This means that the language menu is no longer displayed in the frontend, but the multilingual functionality is still available in the backend.

Delete additional languages

If you want to permanently delete the additional language (English in the standard installation), switch to the "List" backend module and select the "Sample project" page (id = 0).

Scroll down in the right-hand area until you see the "Website language" area. Click on the icon in front of "English" and select the menu item "Delete".

This will delete the additional language and it will no longer be available in the backend. Nevertheless, you must deactivate the display of the language menu as described above so that it is no longer displayed in the frontend.

This page contains automatically translated content.

Updated: 17.07.2024