From: Andreas Fischer Date: Wed, 23 Oct 2013 13:39:50 +0000 (+0200) Subject: Have to also strtolower() on available language name. Otherwise no match. X-Git-Tag: v6.0.0beta2~10^2~3 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=06f2ae082eb6fc04b1c6680bd2f35ca1c2032d59;p=nextcloud-server.git Have to also strtolower() on available language name. Otherwise no match. --- diff --git a/lib/private/l10n.php b/lib/private/l10n.php index 9392cfac05b..0125dca92ee 100644 --- a/lib/private/l10n.php +++ b/lib/private/l10n.php @@ -466,11 +466,13 @@ class OC_L10N implements \OCP\IL10N { foreach($preferences as $preference) { list($prefered_language) = explode(';', $preference); $prefered_language = str_replace('-', '_', $prefered_language); - if( ($key = array_search($prefered_language, $available)) !== false) { - if (is_null($app)) { - self::$language = $available[$key]; + foreach($available as $available_language) { + if ($prefered_language === strtolower($available_language)) { + if (is_null($app)) { + self::$language = $available_language; + } + return $available_language; } - return $available[$key]; } foreach($available as $available_language) { if (substr($prefered_language, 0, 2) === $available_language) {