#111281Allow a site language with a locale the Core does not list
Description
Problem
TYPO3\CMS\Core\Localization\Locales::$languages is the list of languages the backend interface can be switched to, and the list TYPO3 fetches translations from Crowdin for. It is also, as a side effect, the list of locales a frontend site can resolve labels in.
So a site in Zulu, Amharic, Hausa, Yoruba, or any of around thirty further languages that have an ISO 639-1 code, needs a user-defined locale in $GLOBALS['TYPO3_CONF_VARS']['SYS']['localization']['locales']['user'] before a single label of its own sitepackage is read. Those labels are in the site’s own XLF files. Nothing about them depends on the Core knowing the language.
The registration is installation-wide rather than per site, so a multi-site installation declares the language globally for the sake of one site.
OfficialLanguages::$rawData already carries all of these codes, and the site configuration module offers them as site languages. TYPO3 offers the language, accepts translated content in it, and then renders the labels in English.
What this asks for
Which languages the backend interface offers is properly limited: you can only switch to a language a language pack exists for. Which locale a site language resolves labels in should not be limited the same way. Accept any well-formed locale, derive its dependency chain the way a listed language’s is derived, and resolve <locale>.locallang.xlf from the extensions that ship it.
To settle before a patch:
- whether the gate moves out of
Locales::createLocale(), or the frontend path stops going through it - what
Locales::getLocales()and the backend language dropdown return afterwards, sinceUserSettingsItemsProcFuncand the language pack management read the same list - whether a site language’s locale still has to exist as a system locale. #110967 is already removing the per-request
setlocale()dependency, which was one of the reasons the gate was defensible
Related, and not the same
- asks for separate label files where several site languages share one listed locale,
en_GBfor Germany anden_GBfor Hungary. This issue is the other half: a language the Core does not list at all. A fix for either does not give the other.
- is the silent English fallback that makes the present behaviour hard to diagnose.
Out of scope
Translations of the Core itself. Those are maintained on Crowdin by the translation teams and are not part of this repository.
Reviews 0
No change resolves or names this issue in its commit message, and no comment links one.
Fix this issue
Start the commit message of your patch with this. Add what the patch does, and the versions it goes to in "Releases:". How to create a patch
- Commit message
-
[FEATURE] Allow a site language with a locale the Core does not list Resolves: #111281 Releases: main