diff options
author | Morris Jobke <hey@morrisjobke.de> | 2015-09-30 17:29:54 +0200 |
---|---|---|
committer | Morris Jobke <hey@morrisjobke.de> | 2015-09-30 17:29:54 +0200 |
commit | 73819c4f0542bf3e4e270725ce091acf5702b52f (patch) | |
tree | 9c95037e67436b431feca874da602bccb230bf49 /lib | |
parent | acd6c9b605c4d66ab2176bbb1f7b1952c4e7981d (diff) | |
download | nextcloud-server-73819c4f0542bf3e4e270725ce091acf5702b52f.tar.gz nextcloud-server-73819c4f0542bf3e4e270725ce091acf5702b52f.zip |
Fix l10n on master
* $app isn't useful for this case
* kill it with :fire:
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/l10n.php | 19 |
1 files changed, 5 insertions, 14 deletions
diff --git a/lib/private/l10n.php b/lib/private/l10n.php index 168011cfcec..79c44f7f3bd 100644 --- a/lib/private/l10n.php +++ b/lib/private/l10n.php @@ -102,16 +102,11 @@ class OC_L10N implements \OCP\IL10N { } /** - * @param $app * @return string */ - public static function setLanguageFromRequest($app = null) { + public static function setLanguageFromRequest() { if (isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) { - if (is_array($app)) { - $available = $app; - } else { - $available = self::findAvailableLanguages($app); - } + $available = self::findAvailableLanguages(); // E.g. make sure that 'de' is before 'de_DE'. sort($available); @@ -122,17 +117,13 @@ 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_array($app)) { - self::$language = $available_language; - } + self::$language = $available_language; return $available_language; } } foreach ($available as $available_language) { if (substr($preferred_language, 0, 2) === $available_language) { - if (!is_array($app)) { - self::$language = $available_language; - } + self::$language = $available_language; return $available_language; } } @@ -469,7 +460,7 @@ class OC_L10N implements \OCP\IL10N { return $default_language; } - $lang = self::setLanguageFromRequest($app); + $lang = self::setLanguageFromRequest(); if($userId && !$config->getUserValue($userId, 'core', 'lang')) { $config->setUserValue($userId, 'core', 'lang', $lang); } |