Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. I18n in QML doesn't work
Forum Update on Monday, May 27th 2025

I18n in QML doesn't work

Scheduled Pinned Locked Moved Solved QML and Qt Quick
qmli18n
5 Posts 2 Posters 1.4k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    Amir Afendin
    wrote on 15 Sept 2016, 02:36 last edited by
    #1
    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

    1 Reply Last reply
    0
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 15 Sept 2016, 21:54 last edited by
      #2

      Hi,

      Can you show how you wrote the internationalization in QML ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      A 1 Reply Last reply 16 Sept 2016, 02:37
      0
      • S SGaist
        15 Sept 2016, 21:54

        Hi,

        Can you show how you wrote the internationalization in QML ?

        A Offline
        A Offline
        Amir Afendin
        wrote on 16 Sept 2016, 02:37 last edited by
        #3

        @SGaist thanks man, already solved myself, sorry for troubling

        1 Reply Last reply
        0
        • S Offline
          S Offline
          SGaist
          Lifetime Qt Champion
          wrote on 16 Sept 2016, 07:08 last edited by
          #4

          What was the problem ?

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          A 1 Reply Last reply 19 Sept 2016, 02:21
          0
          • S SGaist
            16 Sept 2016, 07:08

            What was the problem ?

            A Offline
            A Offline
            Amir Afendin
            wrote on 19 Sept 2016, 02:21 last edited by
            #5

            @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

            1 Reply Last reply
            0

            4/5

            16 Sept 2016, 07:08

            • Login

            • Login or register to search.
            4 out of 5
            • First post
              4/5
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved