Mime type browser example: Add translator loader code
Enable testing translations. Task-number: QTBUG-127004 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> (cherry picked from commit 7f78908b44373a61d573002ee27926de3b677efe)
This commit is contained in:
parent
c6eff2161e
commit
5fffbba133
@ -6,10 +6,26 @@
|
|||||||
#include <QApplication>
|
#include <QApplication>
|
||||||
#include <QCommandLineParser>
|
#include <QCommandLineParser>
|
||||||
#include <QScreen>
|
#include <QScreen>
|
||||||
|
#if QT_CONFIG(translation)
|
||||||
|
# include <QLocale>
|
||||||
|
# include <QLibraryInfo>
|
||||||
|
# include <QTranslator>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
using namespace Qt::StringLiterals;
|
||||||
|
|
||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
QApplication app(argc, 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);
|
QCoreApplication::setApplicationVersion(QT_VERSION_STR);
|
||||||
|
|
||||||
QCommandLineParser parser;
|
QCommandLineParser parser;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user