]> git.lyx.org Git - lyx.git/blobdiff - src/support/Package.cpp
Fix 'Export As...' in non-English localizations
[lyx.git] / src / support / Package.cpp
index 24cf8ca96bfdc02c29a3a4e60d1594ac1d4b87d9..26870ed91b94e93c2779b2b84c0e578c5f46382b 100644 (file)
@@ -141,7 +141,8 @@ Package::Package(string const & command_line_arg0,
        FileName const configure_script(addName(system_support().absFileName(), "configure.py"));
        configure_command_ = os::python() + ' ' +
                        quoteName(configure_script.toFilesystemEncoding(), quote_python) +
-                       with_version_suffix() + " --binary-dir=" + binary_dir().absFileName();
+                       with_version_suffix() + " --binary-dir=" +
+                       quoteName(FileName(binary_dir().absFileName()).toFilesystemEncoding());
 
        LYXERR(Debug::INIT, "<package>\n"
                << "\tbinary_dir " << binary_dir().absFileName() << '\n'
@@ -167,10 +168,12 @@ void Package::set_temp_dir(FileName const & temp_dir) const
 
 FileName Package::messages_file(string const & c) const
 {
-       if (in_build_dir_)
-               return FileName(top_srcdir().absFileName() + "/po/"
-                               + c + ".gmo");
-       else
+       if (in_build_dir_) {
+               FileName res = FileName(lyx_dir().absFileName() + "/../po/" + c + ".gmo");
+               if (!res.isReadableFile())
+                       res = FileName(top_srcdir().absFileName() + "/po/" + c + ".gmo");
+               return res;
+       } else
                return FileName(locale_dir_.absFileName() + "/" + c
                        + "/LC_MESSAGES/" PACKAGE ".mo");
 }