Merge pull request #15391 from owncloud/fix-language-caching

fix caching of preferred language
This commit is contained in:
Thomas Müller 2015-04-03 22:51:13 +02:00
commit b2b3e1ac94

View file

@ -125,7 +125,7 @@ class OC_L10N implements \OCP\IL10N {
$preferred_language = str_replace('-', '_', $preferred_language);
foreach ($available as $available_language) {
if ($preferred_language === strtolower($available_language)) {
if (is_null($app)) {
if (!is_array($app)) {
self::$language = $available_language;
}
return $available_language;
@ -133,7 +133,7 @@ class OC_L10N implements \OCP\IL10N {
}
foreach ($available as $available_language) {
if (substr($preferred_language, 0, 2) === $available_language) {
if (is_null($app)) {
if (!is_array($app)) {
self::$language = $available_language;
}
return $available_language;
@ -142,6 +142,7 @@ class OC_L10N implements \OCP\IL10N {
}
}
self::$language = 'en';
// Last try: English
return 'en';
}