void
dvdomatic_setup_i18n (string lang)
{
+#ifdef DVDOMATIC_POSIX
+ lang += ".UTF8";
+#endif
+
+ if (!lang.empty ()) {
+ /* Override our environment language; this is essential on
+ Windows.
+ */
+ char cmd[64];
+ snprintf (cmd, sizeof(cmd), "LANGUAGE=%s", lang.c_str ());
+ putenv (cmd);
+ snprintf (cmd, sizeof(cmd), "LANG=%s", lang.c_str ());
+ putenv (cmd);
+ }
+
setlocale (LC_ALL, "");
textdomain ("libdvdomatic");
-
-#ifdef DVDOMATIC_WINDOWS
- string const e = "LANGUAGE=" + lang;
- putenv (e.c_str());
+#ifdef DVDOMATIC_WINDOWS
bindtextdomain ("libdvdomatic", mo_path().string().c_str());
-#endif
+#endif
#ifdef DVDOMATIC_POSIX
bindtextdomain ("libdvdomatic", POSIX_LOCALE_PREFIX);
-#endif
+#endif
}
/** @param start Start position for the crop within the image.
* @return MD5 digest of file's contents.
*/
string
-md5_digest (string file)
+md5_digest (boost::filesystem::path file)
{
- ifstream f (file.c_str(), ios::binary);
+ ifstream f (file.string().c_str(), ios::binary);
if (!f.good ()) {
- throw OpenFileError (file);
+ throw OpenFileError (file.string());
}
f.seekg (0, ios::end);
enhancement channel (sub-woofer)./
*/
string const channels[] = {
- "Left",
- "Right",
- "Centre",
- "Lfe (sub)",
- "Left surround",
- "Right surround",
+ _("Left"),
+ _("Right"),
+ _("Centre"),
+ _("Lfe (sub)"),
+ _("Left surround"),
+ _("Right surround"),
};
return channels[c];