Sprachen im Typo3

In the version of the TYPO3 Introduction Package that we installed, two languages were configured by default: Danish and English. These needed to be changed to German and English, with German serving as the default language.

To do this, select the “List” option in the backend and click on the root directory of the site (the parent directory above the option with the globe icon). This is where you can configure the website languages.

 

 

At the beginning of the installation, the languages were distinguished by numerical IDs, meaning that the non-default language is indicated by 1 in the URL.

 

This can be adjusted in the realurl_autoconf.php file, which can be found in the typo3conf directory. There, the value for the preVars array can be adjusted as follows:

'preVars' => [

            [

                'GETvar' => 'L',

                'valueMap' => [

                    'en' => '1',

                    'de' => '0',

                ],

                'noMatch' => 'bypass',

            ],

        ],

Zum Schluss muss noch in der Language.html im bootstrap Package unter Partials der Language-Switch verändert werden:

<f:switch expression="{item.languageUid}">

                    <f:case value="de">

                        <bk2k:var name="languageTitle" value="Deutsch" />

                        <bk2k:var name="hreflang" value="de-DE" />

                    </f:case>

                    <f:case value="en">

                        <bk2k:var name="languageTitle" value="English" />

                        <bk2k:var name="hreflang" value="en-GB" />

                    </f:case>

                </f:switch>