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. Translation - Model Data

Translation - Model Data

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
5 Posts 3 Posters 995 Views 2 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.
  • dheerendraD Offline
    dheerendraD Offline
    dheerendra
    Qt Champions 2022
    wrote on last edited by
    #1

    I have QML Application. Using ListView. Model is in C++. Data to the model is filled from DB. I would like to publish the app in different languages.

    How can I translate the model data to different languages ? Any ideas ?

    Dheerendra
    @Community Service
    Certified Qt Specialist
    http://www.pthinks.com

    1 Reply Last reply
    4
    • S Offline
      S Offline
      shaan7
      wrote on last edited by
      #2

      What kind of data does the model contain? If it is always going to be from a fixed pool of possible data, you can manually register the strings using QT_TRANSLATE_NOOP.
      Otherwise, you might consider using an online translation API and doing the translations on the fly from the model (return the English data first, and then once your API call is successful, emit dataChanged).

      1 Reply Last reply
      0
      • dheerendraD Offline
        dheerendraD Offline
        dheerendra
        Qt Champions 2022
        wrote on last edited by dheerendra
        #3

        Thanks @shaan7 for the reply. It is not fixed set of data. So we kept QT_TRANSLATE_NOOP out our scope. Data keeps changing everybody 15 days. Data is pushed to DB & app fetches the data from DB & starts working. We have written our own modules to some translation. I was looking at alternative ways as well.

        Dheerendra
        @Community Service
        Certified Qt Specialist
        http://www.pthinks.com

        1 Reply Last reply
        5
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          Hi,

          You have everything in your database, you should also store all translations there un use a setting to determine which one the user wants for the application, then it's a matter of requesting the data for the right language.

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

          1 Reply Last reply
          5
          • dheerendraD Offline
            dheerendraD Offline
            dheerendra
            Qt Champions 2022
            wrote on last edited by
            #5

            @SGaist thanks for reply. This is what we are doing as of now. Just wanted to check whether we have any other option.

            Dheerendra
            @Community Service
            Certified Qt Specialist
            http://www.pthinks.com

            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