mirror of
https://github.com/ZoiteChat/zoitechat.git
synced 2026-03-16 18:50:19 +00:00
Initial version of language selector GUI
This commit is contained in:
@@ -451,6 +451,9 @@ const struct prefs vars[] = {
|
||||
{"gui_input_style", P_OFFINT (style_inputbox), TYPE_BOOL},
|
||||
{"gui_join_dialog", P_OFFINT (gui_join_dialog), TYPE_BOOL},
|
||||
{"gui_lagometer", P_OFFINT (lagometer), TYPE_INT},
|
||||
#ifdef WIN32
|
||||
{"gui_lang", P_OFFSET (gui_lang), TYPE_STR},
|
||||
#endif
|
||||
{"gui_mode_buttons", P_OFFINT (chanmodebuttons), TYPE_BOOL},
|
||||
#ifdef WIN32
|
||||
{"gui_one_instance", P_OFFINT (gui_one_instance), TYPE_BOOL},
|
||||
@@ -746,6 +749,7 @@ load_config (void)
|
||||
prefs.timestamp = 1;
|
||||
#ifdef WIN32
|
||||
prefs.identd = 1;
|
||||
strcpy (prefs.gui_lang, g_getenv ("LC_ALL") ? g_getenv ("LC_ALL") : "en_US");
|
||||
#endif
|
||||
strcpy (prefs.spell_langs, g_getenv ("LC_ALL") ? g_getenv ("LC_ALL") : "en_US");
|
||||
strcpy (prefs.stamp_format, "[%H:%M:%S] ");
|
||||
|
||||
@@ -951,6 +951,7 @@ main (int argc, char *argv[])
|
||||
int ret;
|
||||
|
||||
#ifdef WIN32
|
||||
char hexchat_lang[13]; /* LC_ALL= plus 5 chars of gui_lang and trailing \0 */
|
||||
HANDLE mutex;
|
||||
#endif
|
||||
|
||||
@@ -971,6 +972,10 @@ main (int argc, char *argv[])
|
||||
load_config ();
|
||||
|
||||
#ifdef WIN32
|
||||
/* we MUST do this after load_config () otherwise it would fail */
|
||||
snprintf (hexchat_lang, 12, "LC_ALL=%s", prefs.gui_lang);
|
||||
putenv (hexchat_lang);
|
||||
|
||||
if (prefs.gui_one_instance && !portable_mode ())
|
||||
{
|
||||
DWORD error;
|
||||
|
||||
@@ -117,6 +117,7 @@ struct xchatprefs
|
||||
char font_normal[4 * FONTNAMELEN + 1];
|
||||
char font_main[FONTNAMELEN + 1];
|
||||
char font_alternative[3 * FONTNAMELEN + 1];
|
||||
char gui_lang[6]; /* Just enough for xx_YY plus trailing \0 */
|
||||
#else
|
||||
char font_normal[FONTNAMELEN + 1];
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user