34 std::string nls::current_lang;
43 setlocale (LC_MESSAGES,
"");
49 std::string location =
"/usr/share/locale";
50 const char *domain = myconfig.
game_name.c_str ();
52 bindtextdomain (domain, location.c_str ());
54 bind_textdomain_codeset(domain,
"UTF-8");
62 current_lang = language.empty() ?
"LANGUAGE" :
"LANGUAGE=" + language;
63 putenv ((
char *) current_lang.c_str ());
66 extern int _nl_msg_cat_cntr;
70 setlocale (LC_ALL,
"");
71 setlocale (LC_MESSAGES, language.c_str ());
79 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 const string translate(const string &text)
Translate the given string if it's found in the message catalogue.
static void set_language(const string &language)
Set or change the language to use.
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...