diff options
author | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2009-01-06 13:52:30 +0100 |
---|---|---|
committer | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2009-01-06 15:50:02 +0100 |
commit | bfd1d1bcc2a6ecd7efe301bfbf22a1e9b9188706 (patch) | |
tree | b30134f93042e4afb5554b5f14a83528ed2ef069 /src/main.cpp | |
parent | ce0d7b62824d620ec8c3daceac5710fbbd6b12f1 (diff) | |
download | mana-bfd1d1bcc2a6ecd7efe301bfbf22a1e9b9188706.tar.gz mana-bfd1d1bcc2a6ecd7efe301bfbf22a1e9b9188706.tar.bz2 mana-bfd1d1bcc2a6ecd7efe301bfbf22a1e9b9188706.tar.xz mana-bfd1d1bcc2a6ecd7efe301bfbf22a1e9b9188706.zip |
Added support for internationalization
Merged from the mainline client. Originally implemented by Guillaume
Melquiond, starting with commit 1828eee6a6d91fd385ad1e69d93044516493aa91.
Diffstat (limited to 'src/main.cpp')
-rw-r--r-- | src/main.cpp | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/main.cpp b/src/main.cpp index 83686749..09a1a41d 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -84,6 +84,7 @@ #include "resources/resourcemanager.h" #include "utils/dtor.h" +#include "utils/gettext.h" #include "utils/tostring.h" namespace { @@ -267,7 +268,7 @@ void init_engine(const Options &options) // Add the user's homedir to PhysicsFS search path resman->addToSearchPath(homeDir, false); - // Add the main data directory to our PhysicsFS search path + // Add the main data directories to our PhysicsFS search path if (!options.dataPath.empty()) { resman->addToSearchPath(options.dataPath, true); } @@ -646,6 +647,7 @@ void mapLogin(Network *network, LoginData *loginData) } // namespace +extern "C" char const *_nl_locale_name_default(void); /** Main */ int main(int argc, char *argv[]) @@ -666,6 +668,16 @@ int main(int argc, char *argv[]) printVersion(); return 0; } + +#if ENABLE_NLS +#ifdef WIN32 + putenv(("LANG=" + std::string(_nl_locale_name_default())).c_str()); +#endif + setlocale(LC_MESSAGES, ""); + bindtextdomain("tmw", LOCALEDIR); + textdomain("tmw"); +#endif + // Initialize libxml2 and check for potential ABI mismatches between // compiled version and the shared library actually used. xmlInitParser(); |