summaryrefslogtreecommitdiff
path: root/src/lib/util.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/util.cc')
-rw-r--r--src/lib/util.cc27
1 files changed, 23 insertions, 4 deletions
diff --git a/src/lib/util.cc b/src/lib/util.cc
index 03c1f43dd..593d0e760 100644
--- a/src/lib/util.cc
+++ b/src/lib/util.cc
@@ -246,17 +246,36 @@ dvdomatic_setup ()
ui_thread = this_thread::get_id ();
}
+#ifdef DVDOMATIC_WINDOWS
+boost::filesystem::path
+mo_path ()
+{
+ wchar_t buffer[512];
+ GetModuleFileName (0, buffer, 512 * sizeof(wchar_t));
+ boost::filesystem::path p (buffer);
+ p = p.parent_path ();
+ p = p.parent_path ();
+ p /= "locale";
+ return p;
+}
+#endif
+
void
dvdomatic_setup_i18n (string lang)
{
+ setlocale (LC_ALL, "");
+ textdomain ("libdvdomatic");
+
#ifdef DVDOMATIC_WINDOWS
string const e = "LANGUAGE=" + lang;
putenv (e.c_str());
+
+ bindtextdomain ("libdvdomatic", mo_path().string().c_str());
#endif
-
- setlocale (LC_ALL, "");
- textdomain ("libdvdomatic");
- bindtextdomain ("libdvdomatic", LOCALE_PREFIX);
+
+#ifdef DVDOMATIC_POSIX
+ bindtextdomain ("libdvdomatic", POSIX_LOCALE_PREFIX);
+#endif
}
/** @param start Start position for the crop within the image.