mirror of
https://github.com/friendica/friendica
synced 2025-01-11 01:24:43 +00:00
Simplified conversion
This commit is contained in:
parent
595508a91f
commit
4df7faef6d
1 changed files with 9 additions and 10 deletions
|
@ -414,16 +414,15 @@ class L10n
|
||||||
*/
|
*/
|
||||||
public function convertForLanguageDetection(array $languages): array
|
public function convertForLanguageDetection(array $languages): array
|
||||||
{
|
{
|
||||||
$languages['fi'] = $languages['fi-fi'];
|
foreach ($languages as $key => $language) {
|
||||||
unset($languages['fi-fi']);
|
$newkey = $this->convertCodeForLanguageDetection($key);
|
||||||
$languages['da'] = $languages['da-dk'];
|
if ($newkey != $key) {
|
||||||
unset($languages['da-dk']);
|
if (!isset($languages[$newkey])) {
|
||||||
$languages['nb'] = $languages['nb-no'];
|
$languages[$newkey] = $language;
|
||||||
unset($languages['nb-no']);
|
}
|
||||||
$languages['pt-BR'] = $languages['pt-br'];
|
unset($languages[$key]);
|
||||||
unset($languages['pt-br']);
|
}
|
||||||
$languages['zh-Hans'] = $languages['zh-cn'];
|
}
|
||||||
unset($languages['zh-cn']);
|
|
||||||
|
|
||||||
ksort($languages);
|
ksort($languages);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue