summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorAndreas Fischer <bantu@owncloud.com>2013-10-23 15:39:50 +0200
committerAndreas Fischer <bantu@owncloud.com>2013-10-23 15:39:50 +0200
commit06f2ae082eb6fc04b1c6680bd2f35ca1c2032d59 (patch)
treec963379bd0949ab3130274f125fccd5f9f4c9784 /lib
parentdaf93c45165ac2c73fc1f0d6af513b8c3e497691 (diff)
downloadnextcloud-server-06f2ae082eb6fc04b1c6680bd2f35ca1c2032d59.tar.gz
nextcloud-server-06f2ae082eb6fc04b1c6680bd2f35ca1c2032d59.zip
Have to also strtolower() on available language name. Otherwise no match.
Diffstat (limited to 'lib')
-rw-r--r--lib/private/l10n.php10
1 files changed, 6 insertions, 4 deletions
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) {