summaryrefslogtreecommitdiffstats
path: root/lib/private/L10N/Factory.php
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2017-06-21 11:22:05 +0200
committerJoas Schilling <coding@schilljs.com>2017-06-21 11:34:52 +0200
commit7816c5462531bfb20ab977b430081ab5ccf04755 (patch)
tree9161d24af014df15b2393646cc44fdb7922e181e /lib/private/L10N/Factory.php
parent146c699eb49e05c499bf6673f85a948aecceec97 (diff)
downloadnextcloud-server-7816c5462531bfb20ab977b430081ab5ccf04755.tar.gz
nextcloud-server-7816c5462531bfb20ab977b430081ab5ccf04755.zip
Allow to force a language and set it via the ocs api
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'lib/private/L10N/Factory.php')
-rw-r--r--lib/private/L10N/Factory.php8
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/private/L10N/Factory.php b/lib/private/L10N/Factory.php
index 581ca3fb5d1..399bebb8189 100644
--- a/lib/private/L10N/Factory.php
+++ b/lib/private/L10N/Factory.php
@@ -99,6 +99,12 @@ class Factory implements IFactory {
if ($lang !== null) {
$lang = str_replace(array('\0', '/', '\\', '..'), '', (string) $lang);
}
+
+ $forceLang = $this->config->getSystemValue('force_language', false);
+ if (is_string($forceLang)) {
+ $lang = $forceLang;
+ }
+
if ($lang === null || !$this->languageExists($app, $lang)) {
$lang = $this->findLanguage($app);
}
@@ -125,7 +131,7 @@ class Factory implements IFactory {
}
/**
- * At this point ownCloud might not yet be installed and thus the lookup
+ * At this point Nextcloud might not yet be installed and thus the lookup
* in the preferences table might fail. For this reason we need to check
* whether the instance has already been installed
*