Path to translations.

--HG--
branch : develop
This commit is contained in:
dismine 2014-02-14 21:14:49 +02:00
parent c46681a96a
commit c049379c1e
3 changed files with 17 additions and 11 deletions

View file

@ -27,7 +27,7 @@
*************************************************************************/
#include "pages.h"
#include <stdlib.h> //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"));

View file

@ -31,6 +31,17 @@
#include <QTextCodec>
#include <QtCore>
#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;

View file

@ -30,6 +30,7 @@
#define OPTIONS_H
#include <QFlags>
#include <QString>
#define SceneSize 50000
@ -39,6 +40,8 @@
#define widthMainLine 1.2
#define widthHairLine widthMainLine/3
extern const QString translationsPath;
namespace Scene
{
/**