From a7d07f315e032ddb3f9718f0d6d65b8d3120f090 Mon Sep 17 00:00:00 2001 From: Eduardo Iriarte <39985982+eiriarte-mendez@users.noreply.github.com> Date: Wed, 26 Jan 2022 11:23:55 +0100 Subject: [PATCH] fix: incorrect locale code for Austria (#24) - change typo on locale code. --- src/Service/LanguageService.php | 2 +- tests/Unit/Service/LanguageServiceTest.php | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/Service/LanguageService.php b/src/Service/LanguageService.php index b78bc94..190a9f7 100644 --- a/src/Service/LanguageService.php +++ b/src/Service/LanguageService.php @@ -40,7 +40,7 @@ class LanguageService */ public function __construct($language = 'EN') { - $language = in_array(strtoupper($language), ['AU', 'CH']) ? 'DE' : $language; + $language = in_array(strtoupper($language), ['AT', 'CH']) ? 'DE' : $language; if (!$this->localeFileExists($language)) { $language = 'EN'; diff --git a/tests/Unit/Service/LanguageServiceTest.php b/tests/Unit/Service/LanguageServiceTest.php index a152d9c..892f975 100644 --- a/tests/Unit/Service/LanguageServiceTest.php +++ b/tests/Unit/Service/LanguageServiceTest.php @@ -33,8 +33,12 @@ public function provideTranslatedMessages() { return [ ['DE', 'rp_mouseover_effective_rate', 'Gesamtkosten des Kredits als jährlicher Prozentsatz.'], - ['AU', 'rp_sepa_link', 'Einwilligungserklärung zum SEPA-Mandat lesen'], + ['AT', 'rp_sepa_link', 'Einwilligungserklärung zum SEPA-Mandat lesen'], ['CH', 'wcd_sepa_terms_block_3', 'Es gelten dabei die mit dem Kreditinstitut vereinbarten Bedingungen.'], + ['EN', 'rp_sepa_link', 'Declaration of SEPA mandate'], + // Unknown locale code will use english language by default: + ['AU', 'wcd_sepa_terms_block_3', 'My rights are explained in a statement that I can obtain from my bank.'], + ['FR', 'wcd_sepa_terms_block_3', 'My rights are explained in a statement that I can obtain from my bank.'], ]; }