From fce716b9057681703cd37a7ad74ff43e127bcb01 Mon Sep 17 00:00:00 2001 From: GretaD Date: Wed, 29 Apr 2020 14:42:07 +0200 Subject: Fix languages empty array Signed-off-by: GretaD --- lib/private/L10N/Factory.php | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'lib') 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(); -- cgit v1.2.3