From b5275ec578b277b44a541cda50ed227591e02bea Mon Sep 17 00:00:00 2001 From: Albert Cahalan Date: Sat, 21 Nov 2009 10:52:38 +0000 Subject: [PATCH] locales should work --- src/i18n.c | 14 ++++++-------- src/i18n.h | 10 +--------- src/tuxpaint.c | 12 ------------ 3 files changed, 7 insertions(+), 29 deletions(-) diff --git a/src/i18n.c b/src/i18n.c index 46ca4a23f..f7bfdb944 100644 --- a/src/i18n.c +++ b/src/i18n.c @@ -141,7 +141,7 @@ const char *lang_prefixes[NUM_LANGS] = { // languages which don't use the default font -int lang_use_own_font[] = { +static int lang_use_own_font[] = { LANG_AR, LANG_BO, LANG_GU, @@ -157,26 +157,26 @@ int lang_use_own_font[] = { -1 }; -int lang_use_right_to_left[] = { +static int lang_use_right_to_left[] = { LANG_AR, LANG_HE, -1 }; -int lang_use_right_to_left_word[] = { +static int lang_use_right_to_left_word[] = { #ifdef NO_SDLPANGO LANG_HE, #endif -1 }; -int lang_y_nudge[][2] = { +static int lang_y_nudge[][2] = { {LANG_KM, 4}, {-1, -1} }; -char *langstr; +static char *langstr; int need_own_font; int need_right_to_left; int need_right_to_left_word; @@ -740,15 +740,13 @@ static void do_locale_option(const char *const arg) void setup_i18n(const char *restrict lang, const char *restrict locale, int *button_label_y_nudge) { + printf("lang \"%s\", locale \"%s\"\n", lang, locale); if(lang) set_langstr(lang); if(locale) do_locale_option(locale); setup_language("tuxpaint", button_label_y_nudge); printf("lang_prefixes[%d] is \"%s\"\n", get_current_language(), lang_prefixes[get_current_language()]); - -// ctype_utf8 set_current_language - } void smash_i18n(void) diff --git a/src/i18n.h b/src/i18n.h index d45e6a669..400fdba9d 100644 --- a/src/i18n.h +++ b/src/i18n.h @@ -33,7 +33,7 @@ #define I18N_H #include - +#include "compiler.h" /* Possible languages: */ @@ -139,22 +139,14 @@ typedef struct language_to_locale_struct /* Globals: */ extern const char *lang_prefixes[NUM_LANGS]; -extern int lang_use_own_font[]; -extern int lang_use_right_to_left[]; -extern char *langstr; extern int need_own_font; extern int need_right_to_left; // Right-justify extern int need_right_to_left_word; // Words need to be reversed, too! (e.g., Hebrew, but not Arabic) extern const char *lang_prefix, *short_lang_prefix; -extern const language_to_locale_struct language_to_locale_array[]; - - /* Function prototypes: */ int get_current_language(void); -void show_lang_usage(FILE * f, const char *const prg); -void show_locale_usage(FILE * f, const char *const prg); void setup_i18n(const char *restrict lang, const char *restrict locale, int *button_label_y_nudge); void smash_i18n(void); diff --git a/src/tuxpaint.c b/src/tuxpaint.c index ea8470f01..9da3ff5a7 100644 --- a/src/tuxpaint.c +++ b/src/tuxpaint.c @@ -19079,18 +19079,6 @@ static void setup_config(char *argv[]) setup_i18n(tmpcfg.parsertmp_lang, tmpcfg.parsertmp_locale, &button_label_y_nudge); -#if 0 - if(tmpcfg.parsertmp_lang) - set_langstr(tmpcfg.parsertmp_lang); - if(tmpcfg.parsertmp_locale) - do_locale_option(tmpcfg.parsertmp_locale); - setup_language(getfilename(argv[0]), &button_label_y_nudge); -/* printf("lang_prefixes[%d] is \"%s\"\n", get_current_language(), lang_prefixes[get_current_language()]); */ - -ctype_utf8 set_current_language - -#endif - #if 0 all_locale_fonts