From 153092d28e1e0fc64afaf7c4e1c65c19951476e1 Mon Sep 17 00:00:00 2001 From: Sabina Talipova Date: Wed, 20 Sep 2023 15:50:55 +1200 Subject: [PATCH] MNT Spelling error in Maori language name --- src/i18n/Data/Intl/IntlLocales.php | 4 +++- tests/php/i18n/i18nTest.php | 5 +++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/i18n/Data/Intl/IntlLocales.php b/src/i18n/Data/Intl/IntlLocales.php index 8e5d5b80233..657f4138055 100644 --- a/src/i18n/Data/Intl/IntlLocales.php +++ b/src/i18n/Data/Intl/IntlLocales.php @@ -1455,7 +1455,9 @@ public function getLocales() $locales = $this->config()->get('locales'); $localised = []; foreach ($locales as $code => $default) { - $localised[$code] = $this->localeName($code); + // Fix spelling Maori language + $localeName = str_replace('Maori', 'Māori', $this->localeName($code)); + $localised[$code] = $localeName; } // Save cache diff --git a/tests/php/i18n/i18nTest.php b/tests/php/i18n/i18nTest.php index 79882c9407f..3df59b07b4a 100644 --- a/tests/php/i18n/i18nTest.php +++ b/tests/php/i18n/i18nTest.php @@ -477,4 +477,9 @@ public function testGetLanguageName() return i18n::getData()->languageName('de_CGN'); })); } + + public function testGetLocales() + { + $this->assertEquals('Māori (New Zealand)', i18n::getData()->getLocales()['mi_NZ']); + } }