Data Structures | |
struct | _lang_pref |
Defines | |
#define | NUM_LANGS 9 |
#define | SEARCH_LANG 20 |
Typedefs | |
typedef _lang_pref | LangStruct |
Functions | |
void | httplang_to_locale (char *LocaleString) |
void | offer_languages (void) |
show the language chooser on the login dialog depending on the browser locale change the sequence of the language chooser. | |
void | set_selected_language (char *lang) |
Set the selected language for this session. | |
void | go_selected_language (void) |
Activate the selected language for this session. | |
void | stop_selected_language (void) |
Deactivate the selected language for this session. | |
void | initialize_locales (void) |
Create a locale_t for each available language. | |
Variables | |
char * | AvailLang [NUM_LANGS] |
locale_t | wc_locales [NUM_LANGS] |
#define NUM_LANGS 9 |
how many different locales do we know?
Definition at line 14 of file gettext.c.
Referenced by httplang_to_locale(), initialize_locales(), offer_languages(), and set_selected_language().
#define SEARCH_LANG 20 |
how many langs should we parse?
Definition at line 15 of file gettext.c.
Referenced by httplang_to_locale().
typedef struct _lang_pref LangStruct |
Keep information about one locale
void httplang_to_locale | ( | char * | LocaleString | ) |
we are searching, if this list item has something like ;q=n
get the locale part
get the lang part, which should be allways there
get the area code if any.
no ara code? use lang code
area codes are uppercase
check if we have this lang
match against the LANG part
match against lang and locale
fall back to C
Definition at line 52 of file gettext.c.
References _lang_pref::availability, AvailLang, extract_token(), _lang_pref::lang, lprintf(), NUM_LANGS, num_tokens(), _lang_pref::priority, _lang_pref::region, safestrncpy(), SEARCH_LANG, and _lang_pref::selectedlang.
void set_selected_language | ( | char * | lang | ) |
Set the selected language for this session.
lang | the locale to set. |
Definition at line 215 of file gettext.c.
References AvailLang, and NUM_LANGS.
Referenced by do_login().
void go_selected_language | ( | void | ) |
Activate the selected language for this session.
switch locales
clear the cache
Definition at line 228 of file gettext.c.
References wc_locales.
Referenced by do_login().
void stop_selected_language | ( | void | ) |
char* AvailLang[NUM_LANGS] |
Initial value:
{ "C", "en_US", "de_DE", "it_IT", "es_ES", "en_GB", "da_DK", "fr_FR", "nl_NL" }
Definition at line 18 of file gettext.c.
Referenced by httplang_to_locale(), initialize_locales(), offer_languages(), and set_selected_language().
locale_t wc_locales[NUM_LANGS] |
here we keep the parsed stuff
Definition at line 30 of file gettext.c.
Referenced by go_selected_language(), initialize_locales(), and wc_strftime().