aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUli Heilmeier <uh@heilmeier.eu>2016-01-22 20:36:15 +0100
committerMichael Mann <mmann78@netscape.net>2016-01-24 00:02:43 +0000
commit88cd6552ea861a56df9355e681dcaec50e845bd6 (patch)
treecc2909f160ffd7f69d41d15ae6691cebf834119e
parent720f57d0009fd3941d327d30dc064adbc5feb5a0 (diff)
Qt: Load qt_XX.qm to translate Qt Strings
The Windows installation includes the Qt translations files qt_XX.qm in the installation directory (e.g. C:\Program Files\Wireshark\). However we've tried to load the files only from the QLibraryInfo::TranslationsPath (C:\Qt\5.3\msvc2013_64_opengl\translations\). This path is missing in a normal Windows environment. Therefore strings like "Ctrl" haven't been translated. Change-Id: I45bc873fdd95fd0ab5c79e70d9ff062274f899fe Reviewed-on: https://code.wireshark.org/review/13485 Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com> Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
-rw-r--r--ui/qt/wireshark_application.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/ui/qt/wireshark_application.cpp b/ui/qt/wireshark_application.cpp
index f8532915e0..4a747cdc3f 100644
--- a/ui/qt/wireshark_application.cpp
+++ b/ui/qt/wireshark_application.cpp
@@ -1085,6 +1085,10 @@ void WiresharkApplication::loadLanguage(const QString& newLanguage)
.arg(gchar_free_to_qstring(get_persconffile_path("languages", FALSE))).arg(localeLanguage)))
switchTranslator(wsApp->translator,
QString("wireshark_%1.qm").arg(localeLanguage), gchar_free_to_qstring(get_persconffile_path("languages", FALSE)));
+ if (QFile::exists(QString("%1/qt_%2.qm")
+ .arg(get_datafile_dir()).arg(localeLanguage)))
+ switchTranslator(wsApp->translatorQt,
+ QString("qt_%1.qm").arg(localeLanguage), QString(get_datafile_dir()));
switchTranslator(wsApp->translatorQt,
QString("qt_%1.qm").arg(localeLanguage),
QLibraryInfo::location(QLibraryInfo::TranslationsPath));