Project

General

Profile

Actions

Bug #95807

closed

"default" language code

Added by Aimeos no-lastname-given over 2 years ago. Updated about 1 year ago.

Status:
Resolved
Priority:
Should have
Assignee:
-
Category:
-
Target version:
-
Start date:
2021-10-28
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
11
PHP Version:
Tags:
Complexity:
Is Regression:
Sprint Focus:

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.

Actions #1

Updated by Stefan Bürk over 2 years ago

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 ?

Actions #2

Updated by Aimeos no-lastname-given over 2 years ago

Exactly this line:

'typo3Language' => 'default',     // <--- this one ?

Actions #3

Updated by Georg Ringer about 1 year ago

  • Status changed from New to Resolved

there 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

Actions

Also available in: Atom PDF