summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2011-03-29 16:22:12 +0300
committerAndrei Karas <akaras@inbox.ru>2011-03-29 17:18:48 +0300
commit0cd441867adedc5add8b65a42d0f156e906ab25e (patch)
treedd133bd5396f74c5ece8b1b92b6c60747400379e /src
parentc36fbf56e9adc9de97e96acab753ddbb939c0b8b (diff)
downloadplus-0cd441867adedc5add8b65a42d0f156e906ab25e.tar.gz
plus-0cd441867adedc5add8b65a42d0f156e906ab25e.tar.bz2
plus-0cd441867adedc5add8b65a42d0f156e906ab25e.tar.xz
plus-0cd441867adedc5add8b65a42d0f156e906ab25e.zip
Add fixes for localisation dir in linux portable build and error detection.
Diffstat (limited to 'src')
-rw-r--r--src/Makefile.am4
-rw-r--r--src/main.cpp10
2 files changed, 12 insertions, 2 deletions
diff --git a/src/Makefile.am b/src/Makefile.am
index 825b40718..fb698aee3 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -6,6 +6,10 @@ manaplus_CXXFLAGS = -DPKG_DATADIR=\""$(pkgdatadir)/"\" \
-DLOCALEDIR=\""$(localedir)"\" \
-Wall
+if ENABLE_PORTABLE
+manaplus_CXXFLAGS += -DENABLE_PORTABLE
+endif
+
manaplus_SOURCES = gui/widgets/avatarlistbox.cpp \
gui/widgets/avatarlistbox.h \
gui/widgets/battletab.cpp \
diff --git a/src/main.cpp b/src/main.cpp
index 6efa736e7..beb23a72c 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -196,8 +196,13 @@ static void initInternationalization()
// 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");
textdomain("manaplus");
@@ -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();