Crossfire Server, Branches 1.12  R18729
languages.c File Reference
#include <global.h>
+ Include dependency graph for languages.c:

Go to the source code of this file.

Functions

static void convert_newline (char *line)
 
int get_language (object *op)
 
void i18n_init (void)
 
const char * i18n_translate (int language, int id)
 

Variables

const char * i18n_strings [NUM_LANGUAGES][NUM_I18N_STRINGS]
 
const char * language_codes []
 
const char * language_names []
 

Detailed Description

i18n support routines.

Warning
This file is encoded in UTF-8, take care to not mess the language_names array.

Definition in file languages.c.

Function Documentation

static void convert_newline ( char *  line)
static

Replaces '
' by a newline char.

Since we are replacing 2 chars by 1, no overflow should happen.

Parameters
linetext to replace into.

Definition at line 93 of file languages.c.

References MAX_BUF, and snprintf().

Referenced by i18n_init().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int get_language ( object op)
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().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

const char* i18n_translate ( int  language,
int  id 
)

Variable Documentation

const char* i18n_strings[NUM_LANGUAGES][NUM_I18N_STRINGS]

All translated strings.

Definition at line 51 of file languages.c.

Referenced by i18n_init(), and i18n_translate().

const char* language_codes[]
Initial value:
= {
"en",
"fr",
"nl",
"it",
"de"
}

List of available language codes.

Definition at line 34 of file languages.c.

Referenced by command_help(), command_language(), help_topics(), and i18n_init().

const char* language_names[]
Initial value:
= {
"English",
"Français",
"Nederlands",
"Italiano",
"Deutsch"
}

Language names.

Definition at line 43 of file languages.c.

Referenced by command_language().