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(); 

The file of the translator seems to be loading normally, for the debug gives a message that all the rules are. But the application runs without translation. What could be the reasons?

  • qsTr ("...") for user strings you use in qml? - pier_nasos

1 answer 1

Resolved, the problem was different, put the central piece of code in the if else where the QTranslator object was deleted after the block was completed