summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Lebl <jirka@5z.com>2002-08-22 22:56:32 +0000
committerGeorge Lebl <jirka@src.gnome.org>2002-08-22 22:56:32 +0000
commit59dea77978a334b783794d1b673c752a3d7d0aab (patch)
tree5dbc739be00da56cd11a4a5dd3f6a16e44d3102d
parent22f7e3a6ed85e73b3e004f3002888518c35b9019 (diff)
downloadgdm-59dea77978a334b783794d1b673c752a3d7d0aab.tar.gz
The locale in the locale.alias file can be a comma separated list now and
Thu Aug 22 16:04:56 2002 George Lebl <jirka@5z.com> * gui/gdmlanguages.c, config/locale.alias: The locale in the locale.alias file can be a comma separated list now and we now test locales to make sure they exist. This way we can use the utf8 locales if they exist rather then plain locales. And we also don't list locales that the C library doesn't support in the first place. This should make things very nice if you're installing gdm over the latest redhat betas (as in, you will get utf8 locales as in the redhat version)
-rw-r--r--ChangeLog11
-rw-r--r--config/locale.alias112
-rw-r--r--gui/gdmlanguages.c26
3 files changed, 91 insertions, 58 deletions
diff --git a/ChangeLog b/ChangeLog
index c9a76617..b053802e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+Thu Aug 22 16:04:56 2002 George Lebl <jirka@5z.com>
+
+ * gui/gdmlanguages.c, config/locale.alias: The locale in the
+ locale.alias file can be a comma separated list now and we
+ now test locales to make sure they exist. This way we can
+ use the utf8 locales if they exist rather then plain locales.
+ And we also don't list locales that the C library doesn't support
+ in the first place. This should make things very nice if you're
+ installing gdm over the latest redhat betas (as in, you will
+ get utf8 locales as in the redhat version)
+
Thu Aug 22 12:23:49 2002 George Lebl <jirka@5z.com>
* daemon/gdm.[ch], daemon/server.[ch], daemon/Makefile.am,
diff --git a/config/locale.alias b/config/locale.alias
index 3ae2c31e..c527d145 100644
--- a/config/locale.alias
+++ b/config/locale.alias
@@ -5,61 +5,63 @@
# is used as a label in case gdm doesn't know this language personally,
# else it's ignored.
#
-# The format of this file is just like the locale.alias file, so you could
-# conceivably point gdm at your real locale.alias file if that's a better
-# indication of available languages on your system. Note that the first word
-# cannot contain any spaces.
+# The format of this file is SIMILAR (but not the same to the locale.alias
+# format). You could however point gdm at a real locale.alias and it would
+# still concievably work. Note that the first word cannot contain any spaces.
+# The second word can be a comma separated list of locales to try. GDM will
+# try if each locale exists and only if it does will it show that locale. The
+# list is tried in order and the first working one is used.
#
# - George
-Azerbaijani az_AZ
-Arabic(Egypt) ar_EG
-Arabic(Lebanon) ar_LB
-Basque eu_ES
-Bulgarian bg_BG
-Catalan ca_ES
-Chinese(simplified) zh_CN
-Chinese(traditional) zh_TW
-Croatian hr_HR
-Czech cs_CZ
-Danish da_DK
-Dutch nl_NL
-Estonian et_EE
-English(American) en_US
-English(Australian) en_AU
-English(British) en_GB
-English(Ireland) en_IE
-Finnish fi_FI
-French fr_FR
-Galician gl_ES
-German de_DE
-Greek el_GR
-Hebrew he_IL
-Hungarian hu_HU
-Icelandic is_IS
-Irish ga_IE
-Italian it_IT
-Japanese ja_JP
-Korean ko_KR
-Latvian lv_LV
-Lithuanian lt_LT
-Macedonian mk_MK
-Malay ms_MY
-Norwegian(bokmal) no_NO
-Norwegian(nynorsk) nn_NO
-Polish pl_PL
-Portuguese pt_PT
-Portuguese(Brazilian) pt_BR
-Romanian ro_RO
-Russian ru_RU
-Slovak sk_SK
-Slovenian sl_SI
-Spanish es_ES
-Spanish(Mexico) es_MX
-Swedish sv_SE
-Swedish(Finland) sv_FI
-Tamil ta_IN
-Turkish tr_TR
-Ukrainian uk_UA
-Vietnamese vi_VN
-Walloon wa_BE
+Azerbaijani az_AZ.utf8,az_AZ
+Arabic(Egypt) ar_EG.utf8,ar_EG
+Arabic(Lebanon) ar_LB.utf8,ar_LB
+Basque eu_ES.utf8,eu_ES
+Bulgarian bg_BG.utf8,bg_BG
+Catalan ca_ES.utf8,ca_ES
+Chinese(simplified) zh_CN.utf8,zh_CN
+Chinese(traditional) zh_TW.utf8,zh_TW
+Croatian hr_HR.utf8,hr_HR
+Czech cs_CZ.utf8,cs_CZ
+Danish da_DK.utf8,da_DK
+Dutch nl_NL.utf8,nl_NL
+Estonian et_EE.utf8,et_EE
+English(American) en_US.utf8,en_US
+English(Australian) en_AU.utf8,en_AU
+English(British) en_GB.utf8,en_GB
+English(Ireland) en_IE.utf8,en_IE
+Finnish fi_FI.utf8,fi_FI
+French fr_FR.utf8,fr_FR
+Galician gl_ES.utf8,gl_ES
+German de_DE.utf8,de_DE
+Greek el_GR.utf8,el_GR
+Hebrew he_IL.utf8,he_IL
+Hungarian hu_HU.utf8,hu_HU
+Icelandic is_IS.utf8,is_IS
+Irish ga_IE.utf8,ga_IE
+Italian it_IT.utf8,it_IT
+Japanese ja_JP.utf8,ja_JP
+Korean ko_KR.utf8,ko_KR
+Latvian lv_LV.utf8,lv_LV
+Lithuanian lt_LT.utf8,lt_LT
+Macedonian mk_MK.utf8,mk_MK
+Malay ms_MY.utf8,ms_MY
+Norwegian(bokmal) no_NO.utf8,no_NO
+Norwegian(nynorsk) nn_NO.utf8,nn_NO
+Polish pl_PL.utf8,pl_PL
+Portuguese pt_PT.utf8,pt_PT
+Portuguese(Brazilian) pt_BR.utf8,pt_BR
+Romanian ro_RO.utf8,ro_RO
+Russian ru_RU.utf8,ru_RU
+Slovak sk_SK.utf8,sk_SK
+Slovenian sl_SI.utf8,sl_SI
+Spanish es_ES.utf8,es_ES
+Spanish(Mexico) es_MX.utf8,es_MX
+Swedish sv_SE.utf8,sv_SE
+Swedish(Finland) sv_FI.utf8,sv_FI
+Tamil ta_IN.utf8,ta_IN
+Turkish tr_TR.utf8,tr_TR
+Ukrainian uk_UA.utf8,uk_UA
+Vietnamese vi_VN.utf8,vi_VN
+Walloon wa_BE.utf8,wa_BE
diff --git a/gui/gdmlanguages.c b/gui/gdmlanguages.c
index f3491807..5e77ab42 100644
--- a/gui/gdmlanguages.c
+++ b/gui/gdmlanguages.c
@@ -24,6 +24,8 @@
#include <libgnomeui/libgnomeui.h>
#include <string.h>
+#include <vicious.h>
+
#include "gdmlanguages.h"
typedef struct _Language Language;
@@ -153,7 +155,7 @@ static Language languages [] = {
/*Note translate the N-Z to the N-Z you used in the group label */
{ N_("N-Z|Walloon"), "wa_BE", "Walon", 0 },
/* This is the POSIX/C locale for english, should really be in Other */
- { N_("Other|POSIX/C English"), "C", NULL, 0 },
+ { N_("Other|POSIX/C English"), "C", "POSIX/C English", 0 },
{ NULL, NULL }
};
@@ -400,6 +402,8 @@ gdm_lang_read_locale_file (const char *locale_file)
while (fgets (curline, sizeof (curline), langlist)) {
char *name;
char *lang;
+ char **lang_list;
+ int i;
if (curline[0] <= ' ' ||
curline[0] == '#')
@@ -413,7 +417,20 @@ gdm_lang_read_locale_file (const char *locale_file)
if (lang == NULL)
continue;
- if (g_hash_table_lookup (dupcheck, lang) != NULL) {
+ lang_list = g_strsplit (lang, ",", -1);
+ if (lang_list == NULL)
+ continue;
+
+ lang = NULL;
+ for (i = 0; lang_list[i] != NULL; i++) {
+ if (ve_locale_exists (lang_list[i])) {
+ lang = lang_list[i];
+ break;
+ }
+ }
+ if (lang == NULL ||
+ g_hash_table_lookup (dupcheck, lang) != NULL) {
+ g_strfreev (lang_list);
continue;
}
language = find_lang (lang, &clean);
@@ -436,8 +453,11 @@ gdm_lang_read_locale_file (const char *locale_file)
GINT_TO_POINTER (1));
/* if we have an english locale */
- if (strncmp (lang, "en_", 3) == 0)
+ if (strncmp (lang, "en_", 3) == 0 ||
+ strcmp (lang, "C") == 0)
got_english = TRUE;
+
+ g_strfreev (lang_list);
}
g_hash_table_foreach (dupcheck, (GHFunc) g_free, NULL);