diff --git a/src/dialogs/pages.cpp b/src/dialogs/pages.cpp index d3e8eac15..eecaf4e58 100644 --- a/src/dialogs/pages.cpp +++ b/src/dialogs/pages.cpp @@ -27,7 +27,7 @@ *************************************************************************/ #include "pages.h" -#include //for user name +#include "../options.h" ConfigurationPage::ConfigurationPage(QWidget *parent): QWidget(parent), autoSaveCheck(0), autoTime(0), langCombo(0), osOptionCheck(0), langChanged(false) @@ -126,7 +126,7 @@ QGroupBox *ConfigurationPage::LangGroup() QString checkedLocale = settings.value("configuration/locale", defaultLocale).toString(); QString m_langPath = QApplication::applicationDirPath(); - m_langPath.append("/translations"); + m_langPath.append(translationsPath); QDir dir(m_langPath); QStringList fileNames = dir.entryList(QStringList("valentina_*.qm")); diff --git a/src/main.cpp b/src/main.cpp index 6cb211d25..738e5c879 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -31,6 +31,17 @@ #include #include #include "tablewindow.h" +#include "options.h" + +#ifdef Q_OS_WIN32 + const QString translationsPath = QString("/translations"); +#else + #ifdef QT_DEBUG + const QString translationsPath = QString("/translations"); + #else + const QString translationsPath = QString("/usr/share/valentina/translations"); + #endif +#endif void myMessageOutput(QtMsgType type, const QMessageLogContext &context, const QString &msg) { @@ -83,15 +94,7 @@ int main(int argc, char *argv[]) app.installTranslator(&qtTranslator); QTranslator appTranslator; -#ifdef Q_OS_WIN32 - appTranslator.load("valentina_" + checkedLocale, "./translations"); -#else - #ifdef QT_DEBUG - appTranslator.load("valentina_" + checkedLocale, "./translations"); - #else - appTranslator.load("valentina_" + checkedLocale, "/usr/share/valentina/translations"); - #endif -#endif + appTranslator.load("valentina_" + checkedLocale, translationsPath); app.installTranslator(&appTranslator); MainWindow w; diff --git a/src/options.h b/src/options.h index 3633b6f7a..1c3a8770e 100644 --- a/src/options.h +++ b/src/options.h @@ -30,6 +30,7 @@ #define OPTIONS_H #include +#include #define SceneSize 50000 @@ -39,6 +40,8 @@ #define widthMainLine 1.2 #define widthHairLine widthMainLine/3 +extern const QString translationsPath; + namespace Scene { /**