From c3ab753765d7caac22c97a582cf1216ffe7018f1 Mon Sep 17 00:00:00 2001
From: thomascube <thomas@roundcube.net>
Date: Sat, 07 Jun 2008 07:47:46 -0400
Subject: [PATCH] Fix language detection + update Catala localization

---
 program/include/rcmail.php |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/program/include/rcmail.php b/program/include/rcmail.php
index b01e5fd..6352f80 100644
--- a/program/include/rcmail.php
+++ b/program/include/rcmail.php
@@ -181,21 +181,21 @@
     if (empty($rcube_languages)) {
       @include(INSTALL_PATH . 'program/localization/index.inc');
     }
-
+    
     // check if we have an alias for that language
     if (!isset($rcube_languages[$lang]) && isset($rcube_language_aliases[$lang])) {
       $lang = $rcube_language_aliases[$lang];
     }
-    
     // try the first two chars
-    else if (!isset($rcube_languages[$lang]) && strlen($lang) > 2) {
+    else if (!isset($rcube_languages[$lang])) {
       $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'
+      // expand 'nn' to 'nn_NN'
+      else if (!isset($rcube_languages[$short])) {
         $lang = $short.'_'.strtoupper($short);
       }
     }

--
Gitblit v1.9.1