* Slightly more intelligent language detection.
authorArt Cancro <ajc@citadel.org>
Fri, 9 Dec 2005 18:45:52 +0000 (18:45 +0000)
committerArt Cancro <ajc@citadel.org>
Fri, 9 Dec 2005 18:45:52 +0000 (18:45 +0000)
webcit/ChangeLog
webcit/gettext.c

index 88805841e1eb0b7006b4624ccba979dda6b7f09a..56dcd36ccba840d6218a9e0ef7176a9dd787c4d6 100644 (file)
@@ -1,5 +1,8 @@
 $Id$
 
+Fri Dec  9 13:45:31 EST 2005 ajc
+* Slightly more intelligent language detection.
+
 Thu Dec  8 17:23:46 EST 2005 ajc
 * Detect the browser language, and use it as the default language selection.
 
index e658bea40812062aa928e4f5330c179e14a3933c..c995741107326f4932d0567cd06dc4cb547d2b50 100644 (file)
@@ -30,6 +30,8 @@ void httplang_to_locale(char *LocaleString)
        char lang[64];
        int num_accept = 0;
 
+       lprintf(9, "languageAccept: %s\n", LocaleString);
+
        strcpy(selected_locale, "C");
        num_accept = num_tokens(LocaleString, ',');
 
@@ -45,7 +47,7 @@ void httplang_to_locale(char *LocaleString)
                }
 
                for (j=0; j<NUM_LANGS; ++j) {
-                       if (!strcasecmp(lang, AvailLang[j])) {
+                       if (!strncasecmp(lang, AvailLang[j], strlen(lang))) {
                                strcpy(selected_locale, AvailLang[j]);
                        }
                }