diff options
| author | thomasb <thomasb@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2008-06-07 11:22:59 +0000 |
|---|---|---|
| committer | thomasb <thomasb@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2008-06-07 11:22:59 +0000 |
| commit | 14ee4fe8dadfab31ac81327140424696a09a1107 (patch) | |
| tree | ecd2bd4500d8c7b6aa73578d954308035813ea12 /roundcubemail/program/include/rcmail.php | |
| parent | ce53e76ace1a149884f4c16516c5ed5bb8c0d249 (diff) | |
Cleaned up localization names to unique language_COUNTRY schema according to ISO 639-1 and ISO 3166-1
git-svn-id: https://svn.roundcube.net/trunk@1485 208e9e7b-5314-0410-a742-e7e81cd9613c
Diffstat (limited to 'roundcubemail/program/include/rcmail.php')
| -rw-r--r-- | roundcubemail/program/include/rcmail.php | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/roundcubemail/program/include/rcmail.php b/roundcubemail/program/include/rcmail.php index 5b8e74cdf..b01e5fd2b 100644 --- a/roundcubemail/program/include/rcmail.php +++ b/roundcubemail/program/include/rcmail.php @@ -186,10 +186,18 @@ class rcmail if (!isset($rcube_languages[$lang]) && isset($rcube_language_aliases[$lang])) { $lang = $rcube_language_aliases[$lang]; } - + // try the first two chars - if (!isset($rcube_languages[$lang]) && strlen($lang)>2) { - $lang = $this->language_prop(substr($lang, 0, 2)); + else if (!isset($rcube_languages[$lang]) && strlen($lang) > 2) { + $short = $this->language_prop(substr($lang, 0, 2)); + + // check if we have an alias for the short language code + if (!isset($rcube_languages[$short]) && isset($rcube_language_aliases[$short])) { + $lang = $rcube_language_aliases[$short]; + } + else { // expand 'de' to 'de_DE' + $lang = $short.'_'.strtoupper($short); + } } if (!isset($rcube_languages[$lang]) || !is_dir(INSTALL_PATH . 'program/localization/' . $lang)) { |
