TYPO3 9: Multilanguage

There have been some changes regarding language management in TYPO3 9. Let’s say we want to set up an instance with two languages, german and english. First step is to configure this in the config.yaml:

languages:
  -
    title: Deutsch
    enabled: true
    languageId: '0'
    base: /
    typo3Language: de
    locale: de_DE
    iso-639-1: de
    navigationTitle: ''
    hreflang: ''
    direction: ''
    flag: de
  -
    title: English
    enabled: true
    languageId: '1'
    base: /en
    typo3Language: en
    locale: en_US
    iso-639-1: en
    navigationTitle: ''
    hreflang: ''
    direction: ''
    flag: us

It is no longer necessary to create a “Website Language” element for more languages.

The TCA definition for sys_language_uid changes a bit:

'sys_language_uid' => array(
	'exclude' => 1,
	'label' => 'LLL:EXT:lang/Resources/Private/Language/locallang_general.xlf:LGL.language',
	'config' => array(
		'type' => 'select',
		'special' => 'languages',
		'foreign_table' => 'sys_language',
		'foreign_table_where' => 'ORDER BY sys_language.title',
		'items' => [
			[
				'LLL:EXT:lang/Resources/Private/Language/locallang_general.xlf:LGL.allLanguages',
				-1,
				'flags-multiple'
			]
		],
	),
),

The first entry is the “All” value (-1), this configuration should result in the following:

Language Dropdown after correct configuration

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.