]> git.lyx.org Git - features.git/commitdiff
Correctly find the gmo files in build dir
authorVincent van Ravesteijn <vfr@lyx.org>
Sun, 2 Jun 2013 13:11:37 +0000 (15:11 +0200)
committerVincent van Ravesteijn <vfr@lyx.org>
Sun, 2 Jun 2013 13:32:35 +0000 (15:32 +0200)
The path to the lyx binary is either <build_dir>/bin (CMake) or
<build_dir>/src (autotools). This means the po directory can be found one
directory up.

src/support/Package.cpp

index 2e2aebd2f7a326edb178c6afa4199ff50004bb0c..26870ed91b94e93c2779b2b84c0e578c5f46382b 100644 (file)
@@ -169,15 +169,11 @@ void Package::set_temp_dir(FileName const & temp_dir) const
 FileName Package::messages_file(string const & c) const
 {
        if (in_build_dir_) {
-                FileName res = FileName(lyx_dir().absFileName() + "/po/"
-                                                + c + ".gmo");
-                if (!res.isReadableFile())
-                        res = FileName(top_srcdir().absFileName() + "/po/"
-                                                + c + ".gmo");
-
+               FileName res = FileName(lyx_dir().absFileName() + "/../po/" + c + ".gmo");
+               if (!res.isReadableFile())
+                       res = FileName(top_srcdir().absFileName() + "/po/" + c + ".gmo");
                return res;
-        }
-       else
+       } else
                return FileName(locale_dir_.absFileName() + "/" + c
                        + "/LC_MESSAGES/" PACKAGE ".mo");
 }