diff options
author | Richard Levitte <levitte@openssl.org> | 2018-11-09 05:46:01 +0100 |
---|---|---|
committer | fguillot <fred@kanboard.net> | 2018-11-08 20:46:01 -0800 |
commit | 2674def351e6fd9847376ca069783601c7db45cd (patch) | |
tree | e123cc8faba3118ae49f2770f94cff9873cfa96e | |
parent | 7c2e0f7780207a5e8310a6d7480ff787c1474e5b (diff) |
Add the locale en_GB
-rw-r--r-- | app/Model/LanguageModel.php | 5 | ||||
-rw-r--r-- | tests/units/Model/LanguageTest.php | 5 |
2 files changed, 9 insertions, 1 deletions
diff --git a/app/Model/LanguageModel.php b/app/Model/LanguageModel.php index a84baae9..bce1c53d 100644 --- a/app/Model/LanguageModel.php +++ b/app/Model/LanguageModel.php @@ -29,6 +29,7 @@ class LanguageModel extends Base 'cs_CZ', 'da_DK', 'de_DE', + 'en_GB', 'en_US', 'es_ES', 'fr_FR', @@ -89,7 +90,8 @@ class LanguageModel extends Base 'cs_CZ' => 'Čeština', 'da_DK' => 'Dansk', 'de_DE' => 'Deutsch', - 'en_US' => 'English', + 'en_GB' => 'English (GB)', + 'en_US' => 'English (US)', 'es_ES' => 'Español', 'fr_FR' => 'Français', 'el_GR' => 'Grec', @@ -137,6 +139,7 @@ class LanguageModel extends Base 'ca_ES' => 'ca', 'da_DK' => 'da', 'de_DE' => 'de', + 'en_GB' => 'en-GB', 'en_US' => 'en', 'es_ES' => 'es', 'fr_FR' => 'fr', diff --git a/tests/units/Model/LanguageTest.php b/tests/units/Model/LanguageTest.php index 88f6df6e..a2d83e85 100644 --- a/tests/units/Model/LanguageTest.php +++ b/tests/units/Model/LanguageTest.php @@ -10,6 +10,7 @@ class LanguageTest extends Base { $codes = LanguageModel::getCodes(); $this->assertContains('fr_FR', $codes); + $this->assertContains('en_GB', $codes); $this->assertContains('en_US', $codes); } @@ -17,6 +18,7 @@ class LanguageTest extends Base { $this->assertSame('', LanguageModel::findCode('xx-XX')); $this->assertSame('fr_FR', LanguageModel::findCode('fr-FR')); + $this->assertSame('en_GB', LanguageModel::findCode('en-GB')); $this->assertSame('en_US', LanguageModel::findCode('en-US')); } @@ -37,6 +39,9 @@ class LanguageTest extends Base $languageModel = new LanguageModel($this->container); $this->assertEquals('en_US', $languageModel->getCurrentLanguage()); + $_SESSION['user'] = array('language' => 'en_GB'); + $this->assertEquals('en_GB', $languageModel->getCurrentLanguage()); + $_SESSION['user'] = array('language' => 'fr_FR'); $this->assertEquals('fr_FR', $languageModel->getCurrentLanguage()); |