summaryrefslogtreecommitdiff
path: root/src/main.cpp
diff options
context:
space:
mode:
authorIra Rice <irarice@gmail.com>2009-01-06 10:20:36 -0700
committerIra Rice <irarice@gmail.com>2009-01-06 10:20:36 -0700
commit2a065b5ef24441b0df2c06fbcae6dcf6fd5f5251 (patch)
treed4bee5fa8cb866618995e666ce1fdf37ca174f3b /src/main.cpp
parenta570ee66c7cf6ddff7b0c124ad4b633b4651bdb3 (diff)
downloadmana-client-2a065b5ef24441b0df2c06fbcae6dcf6fd5f5251.tar.gz
mana-client-2a065b5ef24441b0df2c06fbcae6dcf6fd5f5251.tar.bz2
mana-client-2a065b5ef24441b0df2c06fbcae6dcf6fd5f5251.tar.xz
mana-client-2a065b5ef24441b0df2c06fbcae6dcf6fd5f5251.zip
Added support for internationalization
Merged from the mainline client. Originally implemented by Guillaume Melquiond, starting with commit 1828eee6a6d91fd385ad1e69d93044516493aa91. Conflicts: INSTALL configure.ac src/Makefile.am src/gui/buy.cpp src/gui/confirm_dialog.cpp src/gui/inventorywindow.cpp src/gui/login.cpp src/gui/menuwindow.cpp src/gui/minimap.cpp src/gui/ok_dialog.cpp src/gui/popupmenu.cpp src/gui/register.cpp src/gui/sell.cpp src/gui/setup.cpp src/gui/setup_video.cpp Signed-off-by: Ira Rice <irarice@gmail.com>
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/main.cpp b/src/main.cpp
index 7de3823f..55d295dd 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -80,6 +80,7 @@
#include "resources/resourcemanager.h"
#include "utils/dtor.h"
+#include "utils/gettext.h"
#include "utils/tostring.h"
#ifdef __APPLE__
@@ -284,7 +285,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);
}
@@ -679,6 +680,7 @@ void mapLogin(Network *network, LoginData *loginData)
} // namespace
+extern "C" char const *_nl_locale_name_default(void);
/** Main */
int main(int argc, char *argv[])
@@ -699,6 +701,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("aethyra", LOCALEDIR);
+ textdomain("aethyra");
+#endif
+
// Initialize libxml2 and check for potential ABI mismatches between
// compiled version and the shared library actually used.
xmlInitParser();