Another attempt to fix i18n.
authorCarl Hetherington <cth@carlh.net>
Thu, 21 Mar 2013 11:37:50 +0000 (11:37 +0000)
committerCarl Hetherington <cth@carlh.net>
Thu, 21 Mar 2013 11:37:50 +0000 (11:37 +0000)
src/lib/util.cc
windows/installer.nsi.32.in
windows/installer.nsi.64.in
wscript

index abbc357493ec35baba546ef31289a54a2e6aec01..765835bc4b1cc810cadf2ba7f07e06501bb28205 100644 (file)
@@ -251,8 +251,14 @@ dvdomatic_setup ()
 void
 dvdomatic_setup_i18n (string lang)
 {
+#ifdef DVDOMATIC_WINDOWS
+       string const e = "LANGUAGE=" + lang;
+       putenv (e.c_str());
+#endif
+       
+       setlocale (LC_ALL, "");
+       textdomain ("libdvdomatic");
        bindtextdomain ("libdvdomatic", LOCALE_PREFIX);
-       setlocale (LC_ALL, lang.c_str ());
 }
 
 /** @param start Start position for the crop within the image.
index 4911585de86d0c86ad499b35a81cab9c86ef7c1f..b79703ff1fa6968f8328fbb7f603c9bb4ed5a4c1 100644 (file)
@@ -93,10 +93,11 @@ File "%deps%/etc/ImageMagick/delegates.xml"
 SetOutPath "$PROFILE\.magick"
 File "%deps%/etc/ImageMagick/delegates.xml"
 
-SetOutPath "$INSTDIR\bin\fr_FR"
+SetOutPath "$INSTDIR\locale\fr_FR"
 File "%binaries%/src/lib/mo/fr_FR/libdvdomatic.mo"
+File "%binaries%/src/wx/mo/fr_FR/libdvdomatic-wx.mo"
 File "%binaries%/src/tools/mo/fr_FR/dvdomatic.mo"
-SetOutPath "$INSTDIR\bin\it_IT"
+SetOutPath "$INSTDIR\locale\it_IT"
 File "%binaries%/src/lib/mo/it_IT/libdvdomatic.mo"
 File "%binaries%/src/wx/mo/it_IT/libdvdomatic-wx.mo"
 File "%binaries%/src/tools/mo/it_IT/dvdomatic.mo"
index 295f926b630afcbe9fdaef86c5de27657945223e..21980e61ad48a698868f066262773b3f7971283f 100644 (file)
@@ -103,11 +103,11 @@ File "%deps%/etc/ImageMagick/delegates.xml"
 SetOutPath "$PROFILE\.magick"
 File "%deps%/etc/ImageMagick/delegates.xml"
 
-SetOutPath "$INSTDIR\bin\fr_FR"
+SetOutPath "$INSTDIR\locale\fr_FR"
 File "%binaries%/src/lib/mo/fr_FR/libdvdomatic.mo"
+File "%binaries%/src/wx/mo/fr_FR/libdvdomatic-wx.mo"
 File "%binaries%/src/tools/mo/fr_FR/dvdomatic.mo"
-
-SetOutPath "$INSTDIR\bin\it_IT"
+SetOutPath "$INSTDIR\locale\it_IT"
 File "%binaries%/src/lib/mo/it_IT/libdvdomatic.mo"
 File "%binaries%/src/wx/mo/it_IT/libdvdomatic-wx.mo"
 File "%binaries%/src/tools/mo/it_IT/dvdomatic.mo"
diff --git a/wscript b/wscript
index 4f81e493416b5ade9d028d4459c026c6f999c09c..171b71181e40a77587329b340014dc865cfe799d 100644 (file)
--- a/wscript
+++ b/wscript
@@ -22,11 +22,11 @@ def configure(conf):
         conf.load('winres')
 
     conf.env.append_value('CXXFLAGS', ['-D__STDC_CONSTANT_MACROS', '-msse', '-mfpmath=sse', '-ffast-math', '-fno-strict-aliasing',
-                                       '-Wall', '-Wno-attributes', '-Wextra',
-                                       '-DLOCALE_PREFIX="%s/share/locale"' % conf.env['PREFIX']])
+                                       '-Wall', '-Wno-attributes', '-Wextra'])
 
     if conf.options.target_windows:
         conf.env.append_value('CXXFLAGS', ['-DDVDOMATIC_WINDOWS', '-DWIN32_LEAN_AND_MEAN', '-DBOOST_USE_WINDOWS_H', '-DUNICODE'])
+        conv.env.append_value('CXXFLAGS', '-DLOCALE_PREFIX="../locale"')
         wxrc = os.popen('wx-config --rescomp').read().split()[1:]
         conf.env.append_value('WINRCFLAGS', wxrc)
         if conf.options.enable_debug:
@@ -37,6 +37,7 @@ def configure(conf):
         boost_thread = 'boost_thread_win32-mt'
     else:
         conf.env.append_value('CXXFLAGS', '-DDVDOMATIC_POSIX')
+        conf.env.append_value('CXXFLAGS', '-DLOCALE_PREFIX="%s/share/locale"' % conf.env['PREFIX'])
         boost_lib_suffix = ''
         boost_thread = 'boost_thread'
         conf.env.append_value('LINKFLAGS', '-pthread')