summaryrefslogtreecommitdiff
path: root/src/lib/util.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2013-03-21 16:31:48 +0000
committerCarl Hetherington <cth@carlh.net>2013-03-21 16:31:48 +0000
commit1c207805aef4443c5fb6c102e5be8a5b50002868 (patch)
tree97748387388a2a7a644daa0d54a0dfc06bc35f1e /src/lib/util.cc
parentf94ed8f663a5ce6e55484c10dcade6d7b7d2e5ed (diff)
Add Manual Acevedo's initial Spanish translation. Hopefully finally fix up translations on Windows.
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.