Provides various services for i18n and l10n.
More...
#include <nls.h>
|
static void | init (config &myconfig) |
| Initialize national language support. More...
|
|
static void | set_language (const string &language) |
| Set or change the language to use. More...
|
|
static const char * | translate (const string &text) |
| Translate the given string if it's found in the message catalogue. More...
|
|
Provides various services for i18n and l10n.
Definition at line 34 of file nls.h.
void nls::init |
( |
config & |
myconfig | ) |
|
|
static |
Initialize national language support.
- Parameters
-
myconfig | The Engine's configuration |
Definition at line 31 of file nls.cc.
void nls::set_language |
( |
const string & |
language | ) |
|
|
static |
Set or change the language to use.
Setting the language will never fail, but only if there is a binary message catalogue in <gamedir>/po/<country code>="">LC_MESSAGES/ named <gamename>.mo the desired language will be actually used.
- Parameters
-
language | The country code of the desired language. |
Definition at line 53 of file nls.cc.
const char * nls::translate |
( |
const string & |
text | ) |
|
|
static |
Translate the given string if it's found in the message catalogue.
This is just a wrapper around the GNU gettext function for older versions of Python.
- Parameters
-
text | The text to translate |
- Returns
- either the translated text, or the given text if no translation was found.
Definition at line 73 of file nls.cc.
The documentation for this class was generated from the following files: