aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rw-r--r--tools/qml/main.cpp6
-rw-r--r--tools/qmlscene/main.cpp14
2 files changed, 10 insertions, 10 deletions
diff --git a/tools/qml/main.cpp b/tools/qml/main.cpp
index 7a08562a13..69ccd7a316 100644
--- a/tools/qml/main.cpp
+++ b/tools/qml/main.cpp
@@ -450,8 +450,10 @@ int main(int argc, char *argv[])
verboseMode = false;
#ifndef QT_NO_TRANSLATION
- // qt_ translations are loaded by QQmlApplicationEngine
- if (!translationFile.isEmpty()) { // Note: installed before QQmlApplicationEngine's automatic translation loading
+ //qt_ translations loaded by QQmlApplicationEngine
+ QString sysLocale = QLocale::system().name();
+
+ if (!translationFile.isEmpty()) { //Note: installed before QQmlApplicationEngine's automatic translation loading
QTranslator translator;
if (translator.load(translationFile)) {
diff --git a/tools/qmlscene/main.cpp b/tools/qmlscene/main.cpp
index 7c2fd9fc32..208226c8aa 100644
--- a/tools/qmlscene/main.cpp
+++ b/tools/qmlscene/main.cpp
@@ -307,8 +307,7 @@ static void displayFileDialog(Options *options)
#ifndef QT_NO_TRANSLATION
static void loadTranslationFile(QTranslator &translator, const QString& directory)
{
- QLocale locale;
- translator.load(locale, QLatin1String("qml"), QLatin1String("_"), directory + QLatin1String("/i18n"));
+ translator.load(QLatin1String("qml_" )+QLocale::system().name(), directory + QLatin1String("/i18n"));
QCoreApplication::installTranslator(&translator);
}
#endif
@@ -416,18 +415,17 @@ int main(int argc, char ** argv)
app.setOrganizationDomain("qt-project.org");
#ifndef QT_NO_TRANSLATION
- QLocale locale;
+ QTranslator translator;
QTranslator qtTranslator;
- if (qtTranslator.load(locale, QLatin1String("qt"), QLatin1String("_"), QLibraryInfo::location(QLibraryInfo::TranslationsPath)))
+ QString sysLocale = QLocale::system().name();
+ if (qtTranslator.load(QLatin1String("qt_") + sysLocale, QLibraryInfo::location(QLibraryInfo::TranslationsPath)))
app.installTranslator(&qtTranslator);
-
- QTranslator translator;
- if (translator.load(locale, QLatin1String("qmlscene"), QLatin1String("_"), QLibraryInfo::location(QLibraryInfo::TranslationsPath)))
+ if (translator.load(QLatin1String("qmlscene_") + sysLocale, QLibraryInfo::location(QLibraryInfo::TranslationsPath)))
app.installTranslator(&translator);
QTranslator qmlTranslator;
if (!options.translationFile.isEmpty()) {
- if (qmlTranslator.load(locale, options.translationFile)) {
+ if (qmlTranslator.load(options.translationFile)) {
app.installTranslator(&qmlTranslator);
} else {
qWarning() << "Could not load the translation file" << options.translationFile;