[TYPO3-core] RFC #11293: Login page is not translatable
Martin Kutschker
masi-no at spam-typo3.org
Mon Jun 15 21:34:35 CEST 2009
Benjamin Mack schrieb:
> Hey all,
>
> attached is v4 version based on Rupis patch, with extracted language
> detection as masi suggested.
>
> As this patch differs quite much from the initial version, I request two
> new +1s, preferrably one code review from Masi.
I think there is one little bug with languages where the TYPO3 code
differs from the ISO code.
When initialized with $charSetArray the keys contain the TYPO3 codes, so
the next loop must assign ISO vales to TYPO3 keys. Then the array can be
flipped for further processing.
foreach ($GLOBALS['LANG']->csConvObj->isoArray as
$typo3Lang => $isoLang) {
$isoLang = join('-', explode('_', $isoLang));
$allLanguageCodes[$typo3Lang] = $isoLang; // MIND KEY/VALUE!
}
// move ISO codes into the keys
$allLanguageCodes = array_flip($allLanguageCodes);
Or to make it more clear use two arrays: $typo3LanguageCodes and
$isoLanguageCodes.
If I'm not mistaken
asort($sortedPreferredLanguages, SORT_NUMERIC);
$sortedPreferredLanguages = array_reverse($sortedPreferredLanguages);
can be replaced by
arsort($sortedPreferredLanguages, SORT_NUMERIC);
, but I haven't tested it.
So +1 on reading if you put getPreferredClientLanguage() into t3lib_cs,
so some FE code may use it as well (there are extensions for this, so
there is a demand for the functionality).
Masi
More information about the TYPO3-team-core
mailing list