diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/L10N/Factory.php | 13 |
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(); |