summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2016-12-28 13:06:50 +0100
committerStanislaw Halik <sthalik@misaki.pl>2016-12-28 13:07:15 +0100
commit13984a10d01cb325b819d29165acad8939a0318f (patch)
treebc9bc62f7e7d42c69ab0e4d69236a3b8baf97e4b
parent4df3023e479a3a3c0c8071b20c62f98cd69fce0b (diff)
cmake: fix translations on Linux
-rw-r--r--cmake/opentrack-boilerplate.cmake1
-rw-r--r--cmake/opentrack-hier.cmake7
-rw-r--r--gui/main.cpp3
3 files changed, 8 insertions, 3 deletions
diff --git a/cmake/opentrack-boilerplate.cmake b/cmake/opentrack-boilerplate.cmake
index 9ea00238..cba43409 100644
--- a/cmake/opentrack-boilerplate.cmake
+++ b/cmake/opentrack-boilerplate.cmake
@@ -14,6 +14,7 @@ set(new-hier-path "#pragma once
#define OPENTRACK_LIBRARY_PATH \"${opentrack-hier-path}\"
#define OPENTRACK_DOC_PATH \"${opentrack-hier-doc}\"
#define OPENTRACK_CONTRIB_PATH \"${opentrack-hier-doc}contrib/\"
+#define OPENTRACK_I18N_PATH \"${opentrack-i18n-path}\"
")
set(hier-path-filename "${CMAKE_BINARY_DIR}/opentrack-library-path.h")
diff --git a/cmake/opentrack-hier.cmake b/cmake/opentrack-hier.cmake
index 5c58935c..a892311c 100644
--- a/cmake/opentrack-hier.cmake
+++ b/cmake/opentrack-hier.cmake
@@ -17,7 +17,8 @@ if(NOT opentrack-hier-included)
set(opentrack-hier-str RUNTIME DESTINATION . LIBRARY DESTINATION .)
set(opentrack-doc-pfx "./doc")
set(opentrack-doc-src-pfx "./source-code")
- set(opentrack-i18n-pfx "${opentrack-hier-pfx}")
+ set(opentrack-i18n-pfx "./i18n")
+ set(opentrack-i18n-path "./i18n")
elseif(WIN32)
set(opentrack-hier-pfx "./modules")
set(opentrack-hier-path "/modules/")
@@ -26,6 +27,7 @@ if(NOT opentrack-hier-included)
set(opentrack-doc-src-pfx "./source-code")
set(opentrack-hier-str RUNTIME DESTINATION ./modules/ LIBRARY DESTINATION ./modules/)
set(opentrack-i18n-pfx "./i18n")
+ set(opentrack-i18n-path "./i18n")
else()
set(opentrack-hier-pfx "libexec/opentrack")
set(opentrack-hier-path "/../libexec/opentrack/")
@@ -34,7 +36,8 @@ if(NOT opentrack-hier-included)
set(opentrack-doc-src-pfx "./share/doc/opentrack/source-code")
set(opentrack-install-rpath "${CMAKE_INSTALL_PREFIX}/${opentrack-hier-pfx}")
set(opentrack-hier-str ARCHIVE DESTINATION lib/opentrack LIBRARY DESTINATION ${opentrack-hier-pfx} RUNTIME DESTINATION bin)
- set(opentrack-i18n-pfx "libexec/opentrack/i18n")
+ set(opentrack-i18n-pfx "./libexec/opentrack/i18n")
+ set(opentrack-i18n-path "../libexec/opentrack/i18n")
endif()
function(opentrack_escape_string var str)
diff --git a/gui/main.cpp b/gui/main.cpp
index 1f1445c3..661b3d19 100644
--- a/gui/main.cpp
+++ b/gui/main.cpp
@@ -11,6 +11,7 @@
#include "main-window.hpp"
#include "options/options.hpp"
using namespace options;
+#include "opentrack-library-path.h"
#include <QApplication>
#include <QCommandLineParser>
#include <QStyleFactory>
@@ -144,7 +145,7 @@ main(int argc, char** argv)
if (!QSettings(OPENTRACK_ORG).value("disable-translation", false).toBool())
{
- (void) t.load(QLocale(), "", "", QCoreApplication::applicationDirPath() + "/i18n", ".qm");
+ (void) t.load(QLocale(), "", "", QCoreApplication::applicationDirPath() + "/" + OPENTRACK_I18N_PATH, ".qm");
(void) QCoreApplication::installTranslator(&t);
}