37 setlocale (LC_MESSAGES,
"");
43 std::string location =
"/usr/share/locale";
44 const char *domain = myconfig.
game_name.c_str ();
46 bindtextdomain (domain, location.c_str ());
48 bind_textdomain_codeset(domain,
"UTF-8");
57 string lang =
"LANGUAGE=" + language;
58 putenv ((
char *) lang.c_str ());
64 extern int _nl_msg_cat_cntr;
68 setlocale (LC_MESSAGES, language.c_str ());
76 return gettext (text.c_str ());
National Language Support.
static void init(config &myconfig)
Initialize national language support.
string language
Language to use if NLS was compiled in.
static void set_language(const string &language)
Set or change the language to use.
static const char * translate(const string &text)
Translate the given string if it's found in the message catalogue.
string game_name
Name of the game that is running at present.
This class contains the engine's configuration read either from the config file or from the command l...