From da25ca5669ac88985d37a68392ed736ac03dcc3c Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Tue, 5 Apr 2016 03:41:05 +0000 Subject: [PATCH] Fixed determination of a multi-part browser language such as pt-br. --- WEB-INF/lib/I18n.class.php | 3 +++ WEB-INF/resources/pt-br.lang.php | 2 +- WEB-INF/templates/footer.tpl | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/WEB-INF/lib/I18n.class.php b/WEB-INF/lib/I18n.class.php index f21c0a01..0683f91f 100644 --- a/WEB-INF/lib/I18n.class.php +++ b/WEB-INF/lib/I18n.class.php @@ -133,6 +133,9 @@ class I18n { $lang_prefs = explode(',', $acclang); foreach ($lang_prefs as $lang_pref) { $lang_pref_parts = explode(';', trim($lang_pref)); + if ($this->hasLang($lang_pref_parts[0])) { + return $lang_pref_parts[0]; + } $lang_parts = explode('-', trim($lang_pref_parts[0])); $lang_main = $lang_parts[0]; if ($this->hasLang($lang_main)) { diff --git a/WEB-INF/resources/pt-br.lang.php b/WEB-INF/resources/pt-br.lang.php index 481d623d..dce50ae2 100644 --- a/WEB-INF/resources/pt-br.lang.php +++ b/WEB-INF/resources/pt-br.lang.php @@ -44,7 +44,7 @@ $i18n_key_words = array( // TODO: Translate the following: // 'menu.forum' => 'Forum', 'menu.help' => 'Ajuda', -'menu.create_team' => 'Criar nova organização', // TODO: is this good? An organization may have multiple teams in TT. +'menu.create_team' => 'Criar organização', // TODO: is this good? An organization may have multiple teams in TT. 'menu.profile' => 'Perfil', 'menu.time' => 'Tempo', 'menu.expenses' => 'Gastos', diff --git a/WEB-INF/templates/footer.tpl b/WEB-INF/templates/footer.tpl index 70b02fea..66a4d772 100644 --- a/WEB-INF/templates/footer.tpl +++ b/WEB-INF/templates/footer.tpl @@ -12,7 +12,7 @@
-
 Anuko Time Tracker 1.9.23.3484 | Copyright © Anuko | +  Anuko Time Tracker 1.9.24.3485 | Copyright © Anuko | {$i18n.footer.credits} | {$i18n.footer.license} | {$i18n.footer.improve} -- 2.20.1