diff options
author | thomascube <thomas@roundcube.net> | 2008-06-07 11:22:59 +0000 |
---|---|---|
committer | thomascube <thomas@roundcube.net> | 2008-06-07 11:22:59 +0000 |
commit | 235086c7dec474eea538822386c093cf9e1fb93e (patch) | |
tree | f96327b1ac7bd0aa9e043ecfec502347f139153c /program/include | |
parent | 6444cf4b29d29f16ef20513a80898f4db0c3a8c4 (diff) |
Cleaned up localization names to unique language_COUNTRY schema according to ISO 639-1 and ISO 3166-1
Diffstat (limited to 'program/include')
-rw-r--r-- | program/include/rcmail.php | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/program/include/rcmail.php b/program/include/rcmail.php index 5b8e74cdf..b01e5fd2b 100644 --- a/program/include/rcmail.php +++ b/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)) { |