summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorRoeland Jago Douma <rullzer@users.noreply.github.com>2020-05-12 13:41:09 +0200
committerGitHub <noreply@github.com>2020-05-12 13:41:09 +0200
commit3142054de66d1c2afef5d682b7829e181e088a6f (patch)
tree328ace22afdd5156b2fbcb1babae5218583d661f /lib
parent1046d4b145ce5a86908017e90da1ff67cd3c5479 (diff)
parentd8338275c846dcacb878ffb7cfd6ffd912ccaaa3 (diff)
downloadnextcloud-server-3142054de66d1c2afef5d682b7829e181e088a6f.tar.gz
nextcloud-server-3142054de66d1c2afef5d682b7829e181e088a6f.zip
Merge pull request #20877 from nextcloud/backport/20719/stable18
[stable18] Fix languages empty array
Diffstat (limited to 'lib')
-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 bba55385882..00e4bdcc60c 100644
--- a/lib/private/L10N/Factory.php
+++ b/lib/private/L10N/Factory.php
@@ -264,7 +264,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)) {
@@ -586,7 +586,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();