summary refs log tree commit diff stats
path: root/src/common/hexchat.c
diff options
context:
space:
mode:
authorDiogo Sousa <diogogsousa@gmail.com>2013-06-08 02:34:01 +0100
committerDiogo Sousa <diogogsousa@gmail.com>2013-06-08 02:34:01 +0100
commit473ab1673921efa011920e7979cc7e9b7a08f304 (patch)
treee3a5d822eda947f9a5104e6160b56f0ba73ab309 /src/common/hexchat.c
parent951292abe1ce97751b80e62b69623d9f712a0914 (diff)
Now the default configuration tries to set the language from the system
locale, and defaults to english if no language match.

This closes #473.
Diffstat (limited to 'src/common/hexchat.c')
-rw-r--r--src/common/hexchat.c12
1 files changed, 2 insertions, 10 deletions
diff --git a/src/common/hexchat.c b/src/common/hexchat.c
index fb9dde5c..aece9ff3 100644
--- a/src/common/hexchat.c
+++ b/src/common/hexchat.c
@@ -1017,20 +1017,12 @@ static void
 set_locale (void)
 {
 #ifdef WIN32
-	const char const *langs[]={
-		"af", "sq", "am", "ast", "az", "eu", "be", "bg", "ca", "zh_CN",   /* 0 .. 9   */
-		"zh_TW", "cs", "da", "nl", "en_GB", "en", "et", "fi", "fr", "gl", /* 10 .. 19 */
-		"de", "el", "gu", "hi", "hu", "id", "it", "ja", "kn", "rw",       /* 20 .. 29 */
-		"ko", "lv", "lt", "mk", "ml", "ms", "nb", "no", "pl", "pt",       /* 30 .. 39 */
-		"pt_BR", "pa", "ru", "sr", "sk", "sl", "es", "sv", "th", "uk",    /* 40 .. 49 */
-		"vi", "wa"                                                        /* 50 .. */
-	};
 	char hexchat_lang[13];	/* LC_ALL= plus 5 chars of hex_gui_lang and trailing \0 */
 
 	strcpy (hexchat_lang, "LC_ALL=");
 
-	if (0 <= prefs.hex_gui_lang && prefs.hex_gui_lang < sizeof(langs)/sizeof(*langs))
-		strcat (hexchat_lang, langs[prefs.hex_gui_lang]);
+	if (0 <= prefs.hex_gui_lang && prefs.hex_gui_lang < LANGUAGES_LENGTH)
+		strcat (hexchat_lang, languages[prefs.hex_gui_lang]);
 	else
 		strcat (hexchat_lang, "en");