From 1113e85bb84f27a17c84d74ee26a428ab609563f Mon Sep 17 00:00:00 2001 From: Remon van de Kamp Date: Wed, 3 Jan 2018 15:55:23 +0100 Subject: [PATCH 1/2] Fix typo in variable name --- Controller/WebUIController.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Controller/WebUIController.php b/Controller/WebUIController.php index 89d53a31..03a7ee2c 100644 --- a/Controller/WebUIController.php +++ b/Controller/WebUIController.php @@ -251,10 +251,10 @@ private function getMessageFromRequest(Request $request) */ private function getLocale2LanguageMap() { - $configuedLocales = $this->getParameter('php_translation.locales'); + $configuredLocales = $this->getParameter('php_translation.locales'); $names = Intl::getLocaleBundle()->getLocaleNames('en'); $map = []; - foreach ($configuedLocales as $l) { + foreach ($configuredLocales as $l) { $map[$l] = $names[$l]; } From 23d2760e6924ef1494883191abfaa4c9721dd670 Mon Sep 17 00:00:00 2001 From: Remon van de Kamp Date: Wed, 3 Jan 2018 15:55:43 +0100 Subject: [PATCH 2/2] Fall back to locale ID when no name is known for locale --- Controller/WebUIController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Controller/WebUIController.php b/Controller/WebUIController.php index 03a7ee2c..ed1a11ab 100644 --- a/Controller/WebUIController.php +++ b/Controller/WebUIController.php @@ -255,7 +255,7 @@ private function getLocale2LanguageMap() $names = Intl::getLocaleBundle()->getLocaleNames('en'); $map = []; foreach ($configuredLocales as $l) { - $map[$l] = $names[$l]; + $map[$l] = isset($names[$l]) ? $names[$l] : $l; } return $map;