Path to translations.
--HG-- branch : develop
This commit is contained in:
parent
c46681a96a
commit
c049379c1e
|
@ -27,7 +27,7 @@
|
||||||
*************************************************************************/
|
*************************************************************************/
|
||||||
|
|
||||||
#include "pages.h"
|
#include "pages.h"
|
||||||
#include <stdlib.h> //for user name
|
#include "../options.h"
|
||||||
|
|
||||||
ConfigurationPage::ConfigurationPage(QWidget *parent):
|
ConfigurationPage::ConfigurationPage(QWidget *parent):
|
||||||
QWidget(parent), autoSaveCheck(0), autoTime(0), langCombo(0), osOptionCheck(0), langChanged(false)
|
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 checkedLocale = settings.value("configuration/locale", defaultLocale).toString();
|
||||||
|
|
||||||
QString m_langPath = QApplication::applicationDirPath();
|
QString m_langPath = QApplication::applicationDirPath();
|
||||||
m_langPath.append("/translations");
|
m_langPath.append(translationsPath);
|
||||||
QDir dir(m_langPath);
|
QDir dir(m_langPath);
|
||||||
QStringList fileNames = dir.entryList(QStringList("valentina_*.qm"));
|
QStringList fileNames = dir.entryList(QStringList("valentina_*.qm"));
|
||||||
|
|
||||||
|
|
21
src/main.cpp
21
src/main.cpp
|
@ -31,6 +31,17 @@
|
||||||
#include <QTextCodec>
|
#include <QTextCodec>
|
||||||
#include <QtCore>
|
#include <QtCore>
|
||||||
#include "tablewindow.h"
|
#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)
|
void myMessageOutput(QtMsgType type, const QMessageLogContext &context, const QString &msg)
|
||||||
{
|
{
|
||||||
|
@ -83,15 +94,7 @@ int main(int argc, char *argv[])
|
||||||
app.installTranslator(&qtTranslator);
|
app.installTranslator(&qtTranslator);
|
||||||
|
|
||||||
QTranslator appTranslator;
|
QTranslator appTranslator;
|
||||||
#ifdef Q_OS_WIN32
|
appTranslator.load("valentina_" + checkedLocale, translationsPath);
|
||||||
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
|
|
||||||
app.installTranslator(&appTranslator);
|
app.installTranslator(&appTranslator);
|
||||||
|
|
||||||
MainWindow w;
|
MainWindow w;
|
||||||
|
|
|
@ -30,6 +30,7 @@
|
||||||
#define OPTIONS_H
|
#define OPTIONS_H
|
||||||
|
|
||||||
#include <QFlags>
|
#include <QFlags>
|
||||||
|
#include <QString>
|
||||||
|
|
||||||
#define SceneSize 50000
|
#define SceneSize 50000
|
||||||
|
|
||||||
|
@ -39,6 +40,8 @@
|
||||||
#define widthMainLine 1.2
|
#define widthMainLine 1.2
|
||||||
#define widthHairLine widthMainLine/3
|
#define widthHairLine widthMainLine/3
|
||||||
|
|
||||||
|
extern const QString translationsPath;
|
||||||
|
|
||||||
namespace Scene
|
namespace Scene
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue
Block a user