Crossfire Server, Branch 1.12  R12190
Functions | Variables
languages.c File Reference

i18n support routines. More...

#include <global.h>
Include dependency graph for languages.c:

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.

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

All translated strings.

Translation table.

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.

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[]
Initial value:
 {
    "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().