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. Multi language support for Qml based Qt GUI
Forum Updated to NodeBB v4.3 + New Features

Multi language support for Qml based Qt GUI

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
4 Posts 2 Posters 1.0k Views 1 Watching
  • 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.
  • S Offline
    S Offline
    suneelkv
    wrote on last edited by
    #1

    Hi All,

    I am new to Qt, I ve run the arrowpad, hellotr and i18N examples provided with my Qt 5.7 and understood the concept involved in the translations.

    Creating a .ts and .qm file and using QtLinguist to update/release the binary's provide the relevant strings and using QTranslator, but when I tried to use the same for a .qml based window it doesn't seems like generating the tag in .ts.

    Can somebody explain me the concept which I have to look for translating a text string in .qml based language?

    Julien BJ 1 Reply Last reply
    0
    • S suneelkv

      Hi All,

      I am new to Qt, I ve run the arrowpad, hellotr and i18N examples provided with my Qt 5.7 and understood the concept involved in the translations.

      Creating a .ts and .qm file and using QtLinguist to update/release the binary's provide the relevant strings and using QTranslator, but when I tried to use the same for a .qml based window it doesn't seems like generating the tag in .ts.

      Can somebody explain me the concept which I have to look for translating a text string in .qml based language?

      Julien BJ Offline
      Julien BJ Offline
      Julien B
      wrote on last edited by
      #2

      Hello @suneelkv,
      Did you had

      lupdate_only{
      SOURCES += <pathToYourQmlFiles>/*.qml 
      }
      

      to your .pro file?

      Are you using qsTr(" ") for your text in your .qml files?

      1 Reply Last reply
      1
      • S Offline
        S Offline
        suneelkv
        wrote on last edited by
        #3

        Thanks Julien,

        Just now found this, thanks...
        Also when I add this .qml in the .pro the files are getting added twice in the project view directory.
        as they are already added as
        DISTFILES +=
        FeatureModel.qml \

        Should I need to remove the DISTFILES in .pro to exclude the addition twice?

        Julien BJ 1 Reply Last reply
        0
        • S suneelkv

          Thanks Julien,

          Just now found this, thanks...
          Also when I add this .qml in the .pro the files are getting added twice in the project view directory.
          as they are already added as
          DISTFILES +=
          FeatureModel.qml \

          Should I need to remove the DISTFILES in .pro to exclude the addition twice?

          Julien BJ Offline
          Julien BJ Offline
          Julien B
          wrote on last edited by Julien B
          #4

          @suneelkv,

          I think you must keep DISTFILES as it intended for another purpose

          lupdate scan throught SOURCES (and RESSOURCES?) files to extract text to translate. That's why you add .qml files using lupdate_only.

          Nevertheless lupdate_only allow qmake to ignore thoses files for compilation but they still appears in QtCreator inside the Sources folder of your project view directory, even if they are not sources files.

          1 Reply Last reply
          0

          • Login

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