Skip to content

Commit 305f4b1

Browse files
rpkampNyholm
authored andcommitted
Fall back to locale ID when no name is known for locale (#177)
* Fix typo in variable name * Fall back to locale ID when no name is known for locale
1 parent 4698e76 commit 305f4b1

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Controller/WebUIController.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -251,11 +251,11 @@ private function getMessageFromRequest(Request $request)
251251
*/
252252
private function getLocale2LanguageMap()
253253
{
254-
$configuedLocales = $this->getParameter('php_translation.locales');
254+
$configuredLocales = $this->getParameter('php_translation.locales');
255255
$names = Intl::getLocaleBundle()->getLocaleNames('en');
256256
$map = [];
257-
foreach ($configuedLocales as $l) {
258-
$map[$l] = $names[$l];
257+
foreach ($configuredLocales as $l) {
258+
$map[$l] = isset($names[$l]) ? $names[$l] : $l;
259259
}
260260

261261
return $map;

0 commit comments

Comments
 (0)