aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/L10N
diff options
context:
space:
mode:
authorGretaD <gretadoci@gmail.com>2020-04-29 14:42:07 +0200
committerMorris Jobke <hey@morrisjobke.de>2020-05-08 10:03:58 +0200
commitfce716b9057681703cd37a7ad74ff43e127bcb01 (patch)
treed5fbdf6a78c5e7c9a842def41ebff7758910dc22 /lib/private/L10N
parent9012f4f906524765a7cc12f98e878232502f5793 (diff)
downloadnextcloud-server-fce716b9057681703cd37a7ad74ff43e127bcb01.tar.gz
nextcloud-server-fce716b9057681703cd37a7ad74ff43e127bcb01.zip
Fix languages empty array
Signed-off-by: GretaD <gretadoci@gmail.com>
Diffstat (limited to 'lib/private/L10N')
-rw-r--r--lib/private/L10N/Factory.php13
1 files changed, 11 insertions, 2 deletions
diff --git a/lib/private/L10N/Factory.php b/lib/private/L10N/Factory.php
index 03240f48410..9d9e6ac9b26 100644
--- a/lib/private/L10N/Factory.php
+++ b/lib/private/L10N/Factory.php
@@ -263,7 +263,7 @@ class Factory implements IFactory {
if ($this->languageExists($app, $locale)) {
return $locale;
}
-
+
// Try to split e.g: fr_FR => fr
$locale = explode('_', $locale)[0];
if ($this->languageExists($app, $locale)) {
@@ -585,7 +585,16 @@ class Factory implements IFactory {
public function getLanguages() {
$forceLanguage = $this->config->getSystemValue('force_language', false);
if ($forceLanguage !== false) {
- return [];
+ $l = $this->get('lib', $forceLanguage);
+ $potentialName = (string) $l->t('__language_name__');
+
+ return [
+ 'commonlanguages' => [[
+ 'code' => $forceLanguage,
+ 'name' => $potentialName,
+ ]],
+ 'languages' => [],
+ ];
}
$languageCodes = $this->findAvailableLanguages();