I18n in QML doesn't work
Solved
QML and Qt Quick
-
QGuiApplication::setAttribute(Qt::AA_EnableHighDpiScaling); QGuiApplication app(argc, argv); QTranslator ruLang; if (ruLang.load(":/Application_ru")) qDebug() << "we're good.............."; app.installTranslator(&ruLang); QQmlApplicationEngine engine; engine.load(QUrl(QStringLiteral("qrc:/main.qml"))); return app.exec();
It seems like .qm file loads well in C++ side but on QML side i don't see any translations happens
-
Hi,
Can you show how you wrote the internationalization in QML ?
-
What was the problem ?
-
@SGaist funny thing as always:D put
QTranslator ruLang; if (ruLang.load(":/Application_ru")) qDebug() << "we're good.............."; app.installTranslator(&ruLang);
into if else, and at the end of the block QTranslator obviously deleted