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. Language translation
Forum Updated to NodeBB v4.3 + New Features

Language translation

Scheduled Pinned Locked Moved QML and Qt Quick
6 Posts 4 Posters 2.6k 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.
  • H Offline
    H Offline
    Harry443
    wrote on last edited by
    #1

    Hello,
    As per my requirement, i need to translate the entire text in all the screens to the selected language whenever user changes the language settings.
    Can someone help me in how to implement this Qt quick application?

    1 Reply Last reply
    0
    • M Offline
      M Offline
      mlong
      wrote on last edited by
      #2

      A good place to start is "here.":http://qt-project.org/doc/qt-4.8/qdeclarativei18n.html And "here.":http://qt-project.org/doc/qt-4.8/internationalization.html

      Software Engineer
      My views and opinions do not necessarily reflect those of anyone -- living or dead, real or fictional -- in this universe or any other similar multiverse node. Void where prohibited. Your mileage may vary. Caveat emptor.

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

        Not forgetting "bug":https://bugreports.qt-project.org/browse/QTBUG-15602 which means that QML doesn't handle true dynamic translations well. There are some work arounds but they're not very pretty.

        1 Reply Last reply
        0
        • R Offline
          R Offline
          Rocken
          wrote on last edited by
          #4

          Here is one of them:
          "workaround":http://qt-project.org/wiki/How_to_do_dynamic_translation_in_QML

          1 Reply Last reply
          0
          • H Offline
            H Offline
            Harry443
            wrote on last edited by
            #5

            Thank u guys....
            Can someone please share any sample code....i.e. depending on some condition the QML Text Element in Rectangles has to be changed to a different language.
            Is it possible without using C++ and by using only QML?

            1 Reply Last reply
            0
            • S Offline
              S Offline
              SteveKing
              wrote on last edited by
              #6

              The links that @Rocken and @mlong gave have pretty complete examples of what you need to do. I would suggest reading those and following links through the wiki / help to find out what you need.

              You can do most of what you need in QML, but the functionality to load and set the translators will need to be in C++. See the documentation for "QTranslator":http://qt-project.org/doc/qt-4.8/qtranslator.html for help on this.

              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