- gstreamermm-1.0 (>= 1.8.0)
- Qt5 (>= 5.3), including the following components:
- Qt5Core, Qt5Gui, Qt5Widgets, Qt5Svg
+ - Qt translation package (at runtime, not build time)
- libboost >= 1.55 (including the following libs):
- libboost-system
- libboost-filesystem
#include <QDebug>
#include <QDir>
+#include <QLibraryInfo>
#include <QMessageBox>
#include <QWidget>
{
removeTranslator(&app_translator_);
removeTranslator(&qt_translator_);
+ removeTranslator(&qtbase_translator_);
if ((language != "C") && (language != "en")) {
// Application translations
qWarning() << "Translation resource" << resource << "not found";
// Qt translations
- resource = ":/l10n/qtbase_" + language +".qm";
- if (qt_translator_.load(resource))
+ QString tr_path(QLibraryInfo::location(QLibraryInfo::TranslationsPath));
+
+ if (qt_translator_.load("qt_" + language, tr_path))
installTranslator(&qt_translator_);
else
- qWarning() << "Translation resource" << resource << "not found";
+ qWarning() << "QT translations for" << language << "not found at" <<
+ tr_path << ", Qt translations package is probably missing";
+
+ // Qt base translations
+ if (qtbase_translator_.load("qtbase_" + language, tr_path))
+ installTranslator(&qtbase_translator_);
+ else
+ qWarning() << "QT base translations for" << language << "not found at" <<
+ tr_path << ", Qt translations package is probably missing";
}
if (!topLevelWidgets().empty()) {
vector< pair<QString, QString> > output_format_list_;
vector< pair<QString, QString> > pd_list_;
- QTranslator app_translator_, qt_translator_;
+ QTranslator app_translator_, qt_translator_, qtbase_translator_;
};
#endif // PULSEVIEW_PV_APPLICATION_HPP