Mime type browser example: Add translator loader code
Enable testing translations. Task-number: QTBUG-127004 Pick-to: 6.8 Change-Id: Ie83092b4db5bcf516834cf0b5b564a67d7ab6227 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> (cherry picked from commit 8778a493606c8733d72db1c09fff5e4bf1f13cc0) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
parent
9413c19cc1
commit
7f78908b44
@ -6,10 +6,26 @@
|
||||
#include <QApplication>
|
||||
#include <QCommandLineParser>
|
||||
#include <QScreen>
|
||||
#if QT_CONFIG(translation)
|
||||
# include <QLocale>
|
||||
# include <QLibraryInfo>
|
||||
# include <QTranslator>
|
||||
#endif
|
||||
|
||||
using namespace Qt::StringLiterals;
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
QApplication app(argc, argv);
|
||||
|
||||
#if QT_CONFIG(translation)
|
||||
QTranslator translator;
|
||||
if (translator.load(QLocale::system(), "qtbase"_L1, "_"_L1,
|
||||
QLibraryInfo::path(QLibraryInfo::TranslationsPath))) {
|
||||
app.installTranslator(&translator);
|
||||
}
|
||||
#endif
|
||||
|
||||
QCoreApplication::setApplicationVersion(QT_VERSION_STR);
|
||||
|
||||
QCommandLineParser parser;
|
||||
|
Loading…
x
Reference in New Issue
Block a user