summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--app/Model/LanguageModel.php5
-rw-r--r--tests/units/Model/LanguageTest.php5
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());