locales should work
This commit is contained in:
parent
0045bbad98
commit
b5275ec578
3 changed files with 7 additions and 29 deletions
14
src/i18n.c
14
src/i18n.c
|
|
@ -141,7 +141,7 @@ const char *lang_prefixes[NUM_LANGS] = {
|
||||||
|
|
||||||
|
|
||||||
// languages which don't use the default font
|
// languages which don't use the default font
|
||||||
int lang_use_own_font[] = {
|
static int lang_use_own_font[] = {
|
||||||
LANG_AR,
|
LANG_AR,
|
||||||
LANG_BO,
|
LANG_BO,
|
||||||
LANG_GU,
|
LANG_GU,
|
||||||
|
|
@ -157,26 +157,26 @@ int lang_use_own_font[] = {
|
||||||
-1
|
-1
|
||||||
};
|
};
|
||||||
|
|
||||||
int lang_use_right_to_left[] = {
|
static int lang_use_right_to_left[] = {
|
||||||
LANG_AR,
|
LANG_AR,
|
||||||
LANG_HE,
|
LANG_HE,
|
||||||
-1
|
-1
|
||||||
};
|
};
|
||||||
|
|
||||||
int lang_use_right_to_left_word[] = {
|
static int lang_use_right_to_left_word[] = {
|
||||||
#ifdef NO_SDLPANGO
|
#ifdef NO_SDLPANGO
|
||||||
LANG_HE,
|
LANG_HE,
|
||||||
#endif
|
#endif
|
||||||
-1
|
-1
|
||||||
};
|
};
|
||||||
|
|
||||||
int lang_y_nudge[][2] = {
|
static int lang_y_nudge[][2] = {
|
||||||
{LANG_KM, 4},
|
{LANG_KM, 4},
|
||||||
{-1, -1}
|
{-1, -1}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
char *langstr;
|
static char *langstr;
|
||||||
int need_own_font;
|
int need_own_font;
|
||||||
int need_right_to_left;
|
int need_right_to_left;
|
||||||
int need_right_to_left_word;
|
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)
|
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)
|
if(lang)
|
||||||
set_langstr(lang);
|
set_langstr(lang);
|
||||||
if(locale)
|
if(locale)
|
||||||
do_locale_option(locale);
|
do_locale_option(locale);
|
||||||
setup_language("tuxpaint", button_label_y_nudge);
|
setup_language("tuxpaint", button_label_y_nudge);
|
||||||
printf("lang_prefixes[%d] is \"%s\"\n", get_current_language(), lang_prefixes[get_current_language()]);
|
printf("lang_prefixes[%d] is \"%s\"\n", get_current_language(), lang_prefixes[get_current_language()]);
|
||||||
|
|
||||||
// ctype_utf8 set_current_language
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void smash_i18n(void)
|
void smash_i18n(void)
|
||||||
|
|
|
||||||
10
src/i18n.h
10
src/i18n.h
|
|
@ -33,7 +33,7 @@
|
||||||
#define I18N_H
|
#define I18N_H
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
#include "compiler.h"
|
||||||
|
|
||||||
/* Possible languages: */
|
/* Possible languages: */
|
||||||
|
|
||||||
|
|
@ -139,22 +139,14 @@ typedef struct language_to_locale_struct
|
||||||
/* Globals: */
|
/* Globals: */
|
||||||
|
|
||||||
extern const char *lang_prefixes[NUM_LANGS];
|
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_own_font;
|
||||||
extern int need_right_to_left; // Right-justify
|
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 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 char *lang_prefix, *short_lang_prefix;
|
||||||
extern const language_to_locale_struct language_to_locale_array[];
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* Function prototypes: */
|
/* Function prototypes: */
|
||||||
|
|
||||||
int get_current_language(void);
|
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 setup_i18n(const char *restrict lang, const char *restrict locale, int *button_label_y_nudge);
|
||||||
void smash_i18n(void);
|
void smash_i18n(void);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -19079,18 +19079,6 @@ static void setup_config(char *argv[])
|
||||||
|
|
||||||
setup_i18n(tmpcfg.parsertmp_lang, tmpcfg.parsertmp_locale, &button_label_y_nudge);
|
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
|
#if 0
|
||||||
|
|
||||||
all_locale_fonts
|
all_locale_fonts
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue