|
Crossfire Server, Branch 1.12
R12190
|
i18n support routines. More...
#include <global.h>
Go to the source code of this file.
Functions | |
| static void | convert_newline (char *line) |
| Replaces ' ' by a newline char. | |
| int | get_language (object *op) |
| Returns the i18n language index associated with the given object. | |
| void | i18n_init (void) |
| Initializes the i18n subsystem. | |
| const char * | i18n_translate (int language, int id) |
| Translates a given i18n string into the provided language. | |
Variables | |
| const char * | i18n_strings [NUM_LANGUAGES][NUM_I18N_STRINGS] |
| All translated strings. | |
| const char * | language_codes [] |
| List of available language codes. | |
| const char * | language_names [] |
| Language names. | |
i18n support routines.
Definition in file languages.c.
| static void convert_newline | ( | char * | line | ) | [static] |
Replaces '
' by a newline char.
Since we are replacing 2 chars by 1, no overflow should happen.
| line | text to replace into. |
Definition at line 93 of file languages.c.
References MAX_BUF, and snprintf().
Referenced by i18n_init().


| int get_language | ( | object * | op | ) |
Returns the i18n language index associated with the given object.
This only has a meaning for players.
| op | The player object to get the language of |
Definition at line 59 of file languages.c.
References NUM_LANGUAGES.
Referenced by command_afk(), command_applymode(), command_body(), command_bowmode(), command_brace(), command_debug(), command_explore(), command_help(), command_kill_pets(), command_language(), command_listen(), command_output_count(), command_output_sync(), command_passwd(), command_peaceful(), command_petmode(), command_players(), command_quit(), command_resistances(), command_save(), command_showpets(), command_sound(), command_statistics(), command_title(), command_usekeys(), command_whereabouts(), command_wimpy(), command_wizcast(), command_wizpass(), current_map_info(), current_region_info(), help_topics(), list_players(), malloc_info(), map_info(), receive_player_password(), and show_commands().

| void i18n_init | ( | void | ) |
Initializes the i18n subsystem.
Definition at line 108 of file languages.c.
References convert_newline(), Settings::datadir, HUGE_BUF, i18n_strings, language_codes, llevDebug, llevError, LOG(), MAX_BUF, NUM_LANGUAGES, settings, snprintf(), and strerror_local().
Referenced by init_library().


| const char* i18n_translate | ( | int | language, |
| int | id | ||
| ) |
Translates a given i18n string into the provided language.
| language | The language numerical code to translate the string to |
| id | The i18n string identifier |
Definition at line 73 of file languages.c.
References i18n_strings, NUM_I18N_STRINGS, and NUM_LANGUAGES.
Referenced by command_afk(), command_applymode(), command_body(), command_bowmode(), command_brace(), command_debug(), command_explore(), command_help(), command_kill_pets(), command_language(), command_listen(), command_output_count(), command_output_sync(), command_passwd(), command_peaceful(), command_petmode(), command_players(), command_quit(), command_resistances(), command_save(), command_showpets(), command_sound(), command_statistics(), command_title(), command_usekeys(), command_whereabouts(), command_wimpy(), command_wizcast(), command_wizpass(), current_map_info(), current_region_info(), help_topics(), list_players(), malloc_info(), map_info(), receive_player_password(), and show_commands().

| const char* i18n_strings[NUM_LANGUAGES][NUM_I18N_STRINGS] |
All translated strings.
Translation table.
Definition at line 51 of file languages.c.
Referenced by i18n_init(), and i18n_translate().
| const char* language_codes[] |
{
"en",
"fr",
"nl",
"it",
"de"
}
List of available language codes.
Language codes ("en", "fr", etc.) table.
Definition at line 34 of file languages.c.
Referenced by command_help(), command_language(), help_topics(), and i18n_init().
| const char* language_names[] |
{
"English",
"Français",
"Nederlands",
"Italiano",
"Deutsch"
}
Language names.
Language names ("English", "French", etc.) table.
Definition at line 43 of file languages.c.
Referenced by command_language().
1.7.6.1