#95807"default" language code
Description
Using “default” as language code if none was selected in the site configuration was a bad idea because the language codes were defined as ISO language codes (“de”/“en” or “DE_CH”/“en_US”) in TYPO3 and had been used since years. Now, instead of having an empty string or NULL if the language code isn’t set, “default” is returned and we need to check in several places now using
!in_array( $lang, ['', 'default'] )
On the other hand, there’s no clear advantage of using “default” instead of an empty string. Instead, this is an invalid ISO language code and we had to adapt all our checks. For standard compliance, we would suggest to think again about that decision and maybe revert it in TYPO3 12.
Reviews 0
No change resolves or names this issue in its commit message, and no comment links one.
History 4
-
Stefan Bürk commented 11/06/21, 19:36
-
Aimeos no-lastname-given commented 11/07/21, 11:25
Exactly this line:
'typo3Language' => 'default', // <--- this one ?
-
Georg Ringer commented and changed status
NewResolved 02/17/23, 07:11there has been a lot of changes in v12 to use a new Locale object and the “default” has been removed, see e.g. #99882 and its related rst
closing the issue as no change will be done for v11
-
Benni Mack changed status
ResolvedClosed 07/09/24, 12:45
Are you relating to this default for site config reading, if no language(s) were specified in the site-config:
$configuration['languages'] = !empty($configuration['languages']) ? $configuration['languages'] : [ 0 => [ 'languageId' => 0, 'title' => 'Default', 'navigationTitle' => '', 'typo3Language' => 'default', // <--- this one ? 'flag' => 'us', 'locale' => 'en_US.UTF-8', 'iso-639-1' => 'en', 'hreflang' => 'en-US', 'direction' => '', ], ];Or what did you meant with your in array check ?