Skip to content

Commit 679c26e

Browse files
committed
Fix languages empty array
Signed-off-by: GretaD <gretadoci@gmail.com>
1 parent 2726c6d commit 679c26e

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

lib/private/L10N/Factory.php

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ public function findLanguageFromLocale(string $app = 'core', string $locale = nu
263263
if ($this->languageExists($app, $locale)) {
264264
return $locale;
265265
}
266-
266+
267267
// Try to split e.g: fr_FR => fr
268268
$locale = explode('_', $locale)[0];
269269
if ($this->languageExists($app, $locale)) {
@@ -585,7 +585,16 @@ public function createPluralFunction($string) {
585585
public function getLanguages() {
586586
$forceLanguage = $this->config->getSystemValue('force_language', false);
587587
if ($forceLanguage !== false) {
588-
return [];
588+
$l = $this->get('lib', $forceLanguage);
589+
$potentialName = (string) $l->t('__language_name__');
590+
591+
return [
592+
'commonlanguages' => [[
593+
'code' => $forceLanguage,
594+
'name' => $potentialName,
595+
]],
596+
'languages' => [],
597+
];
589598
}
590599

591600
$languageCodes = $this->findAvailableLanguages();

0 commit comments

Comments
 (0)