From 0cd441867adedc5add8b65a42d0f156e906ab25e Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Tue, 29 Mar 2011 16:22:12 +0300 Subject: Add fixes for localisation dir in linux portable build and error detection. --- src/main.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src/main.cpp') diff --git a/src/main.cpp b/src/main.cpp index 6efa736e7..beb23a72c 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -195,8 +195,13 @@ static void initInternationalization() putenv(("LANG=" + std::string(_nl_locale_name_default())).c_str()); // mingw doesn't like LOCALEDIR to be defined for some reason bindtextdomain("manaplus", "translations/"); +#else +#if ENABLE_PORTABLE + bindtextdomain("manaplus", (std::string(PHYSFS_getBaseDir()) + + "../locale/").c_str()); #else bindtextdomain("manaplus", LOCALEDIR); +#endif #endif setlocale(LC_MESSAGES, ""); bind_textdomain_codeset("manaplus", "UTF-8"); @@ -244,8 +249,6 @@ int main(int argc, char *argv[]) return 0; } - initInternationalization(); - // Initialize PhysicsFS if (!PHYSFS_init(argv[0])) { @@ -253,6 +256,9 @@ int main(int argc, char *argv[]) << PHYSFS_getLastError() << std::endl; return 1; } + + initInternationalization(); + atexit((void(*)()) PHYSFS_deinit); initXML(); -- cgit v1.2.3-70-g09d2