summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJörn Friedrich Dreyer <jfd@butonic.de>2015-10-02 08:56:33 +0200
committerJörn Friedrich Dreyer <jfd@butonic.de>2015-10-02 08:56:33 +0200
commitb18307aafbe55cb2ee1e048d10514392c54b73be (patch)
tree73bfb33b26154b2e01bf79953284fa40d5803247
parent3b4592718a40100d794a638559ead647dd5d1e2e (diff)
parent73819c4f0542bf3e4e270725ce091acf5702b52f (diff)
downloadnextcloud-server-b18307aafbe55cb2ee1e048d10514392c54b73be.tar.gz
nextcloud-server-b18307aafbe55cb2ee1e048d10514392c54b73be.zip
Merge pull request #19480 from owncloud/fix-l10n
Fix l10n on master
-rw-r--r--lib/private/l10n.php19
1 files changed, 5 insertions, 14 deletions
diff --git a/lib/private/l10n.php b/lib/private/l10n.php
index ad02ba88526..89ce2bc8d72 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);
}