summaryrefslogtreecommitdiffstats
path: root/src/rcclocale.c
diff options
context:
space:
mode:
authorSuren A. Chilingaryan <csa@dside.dyndns.org>2005-07-14 17:59:15 +0000
committerSuren A. Chilingaryan <csa@dside.dyndns.org>2005-07-14 17:59:15 +0000
commit3e5322512be81527430059b901747df7692a6855 (patch)
tree1a7ffe1229f4a5077f11cbdd0fabc246305abfbb /src/rcclocale.c
parentf15620c372b8813a87d07eee169cf2096c99c173 (diff)
downloadlibrcc-3e5322512be81527430059b901747df7692a6855.tar.gz
librcc-3e5322512be81527430059b901747df7692a6855.tar.bz2
librcc-3e5322512be81527430059b901747df7692a6855.tar.xz
librcc-3e5322512be81527430059b901747df7692a6855.zip
Localisation
Diffstat (limited to 'src/rcclocale.c')
-rw-r--r--src/rcclocale.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/rcclocale.c b/src/rcclocale.c
index 838dfd6..9095bca 100644
--- a/src/rcclocale.c
+++ b/src/rcclocale.c
@@ -41,11 +41,14 @@ int rccLocaleGetLanguage(char *result, const char *lv, unsigned int n) {
locale_class = rccLocaleGetClassByName(lv);
if (locale_class >= 0) {
l = setlocale(locale_class, NULL);
- if (!l) return -1;
- else if ((strcmp(l,"C")==0)||(strcmp(l,"POSIX")==0)) return -1;
- } else return -1;
+ } else {
+ if (!strcasecmp(lv, "LANG")) l = getenv("LANG");
+ else if (!strcasecmp(lv, "LANGUAGE")) l = getenv("LANGUAGE");
+ else l = NULL;
+ }
+ if ((!l)||(strcmp(l,"C")==0)||(strcmp(l,"POSIX")==0)) return -1;
- for (i=0;((l[i])&&(l[i]!='.'));i++);
+ for (i=0;((l[i])&&(l[i]!='.')&&(l[i]!=':'));i++);
for (j=0;rcc_default_aliases[j].alias;j++)
if (strncmp(l,rcc_default_aliases[j].alias,i)==0) {