Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. Internationalization with Qt VS Tools
QtWS25 Last Chance

Internationalization with Qt VS Tools

Scheduled Pinned Locked Moved Solved Qt Creator and other tools
5 Posts 3 Posters 2.0k 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.
  • W Offline
    W Offline
    wasawi
    wrote on 8 Aug 2017, 09:05 last edited by
    #1

    Hi everyone,
    My first post here. I'm quite new to Qt.
    I'm planning to develop a multi-platform application using Qt and I'm planning to support two languages. I'm not using QtCreator. So far I'm quite happy with Qt VS Tools, so I would like to stay there if possible.

    My question is: how well is the whole Internationalization process supported under Qt VS Tools? Will I encounter difficulties because of not having a Qt Creator project?

    I'm still reading the documentation about Internationalization, so I'm still not quite familiar with the process.

    Thank you very much for any insight.

    Edit:
    As for today @Karsten-Heimrich states at the Qt VS Tools page:
    "Known Issues: Missing localization support"

    Does that mean that I will be forced to have a .pro file in order to use translation files?

    1 Reply Last reply
    0
    • P Offline
      P Offline
      Pablo J. Rogina
      wrote on 8 Aug 2017, 19:16 last edited by
      #2

      @wasawi I'm not familiar with Qt VS Tools since I always use Qt Creator, but I'm familiar with the internationalization process/flow in Qt so I'll describe it briefly as you mentioned you're new to Qt.

      1. Wrap all your "translatable" strings with tr() method
      QLabel *lbl = new QLabel(tr("Address:");
      
      1. Run lupdate program to create .ts (XML files) for all the languages set in your .pro project file
      TRANSLATIONS = myapp_es.ts \
             myapp_fr.ts
      
      1. Run linguist and open the .ts files, and provide the appropriate translation for every string. Repeat for all your language files.
      2. Run lrelease program to convert your translated .ts files into compiled .qm files
      3. Distribute (or embedded into executable, by means of resource file .qrc) your .qm files

      Most of those steps are carried on from Qt Creator itself. You can read more about the translation tools in Qt here.

      But it turned out that reading Qt VS Tools documentation, you'll have quite the same approach from within Visual Studio itself.

      Please let us know it it works properly. Happy translations!

      Upvote the answer(s) that helped you solve the issue
      Use "Topic Tools" button to mark your post as Solved
      Add screenshots via postimage.org
      Don't ask support requests via chat/PM. Please use the forum so others can benefit from the solution in the future

      1 Reply Last reply
      3
      • P Offline
        P Offline
        patrik08
        wrote on 8 Aug 2017, 19:41 last edited by
        #3

        Hi... languages support is optimal the best... at this time i work by one "Recognition of language" support inside qt5 ...
        one simple header file can sniff the language from text user in 2millisecond ...sample at:
        https://github.com/pehohlva/DocSpeacker/blob/master/3rdparty/cld/datamodelqchar.h + language list 120 or more
        I think the translation files will be over in the coming years or month...
        voice (25 language support) and text (120 language support) having a perfect quality by correct setting and automation from developer...

        1 Reply Last reply
        0
        • W Offline
          W Offline
          wasawi
          wrote on 10 Aug 2017, 09:12 last edited by
          #4

          Hi again,
          Thank you for your help.
          I have successfully created an application which can be translated at runtime with both QtCreator and Visual Studio.

          It toke me a while to understand that environment variables are not always immediately updated depending on where you run your application from, sometimes you need to restart your cmd or ConEmu.

          Some helpful links:

          Translation process overview:
          http://doc.qt.io/qt-5/linguist-overview.html

          Internationalization with Qt
          http://doc.qt.io/qt-5/internationalization.html

          Dynamic (runtime) translation
          https://wiki.qt.io/How_to_create_a_multi_language_application

          Developers manual:
          http://doc.qt.io/qt-5/linguist-programmers.html

          1 Reply Last reply
          0
          • P Offline
            P Offline
            Pablo J. Rogina
            wrote on 10 Aug 2017, 13:19 last edited by
            #5

            @wasawi Glad you have solved your issue, and that you have replied with a good summary of applicable links, not a lot of people does that once their problem is gone.

            Please don't forget to mark the post as solved. Thanks.

            Upvote the answer(s) that helped you solve the issue
            Use "Topic Tools" button to mark your post as Solved
            Add screenshots via postimage.org
            Don't ask support requests via chat/PM. Please use the forum so others can benefit from the solution in the future

            1 Reply Last reply
            1

            3/5

            8 Aug 2017, 19:41

            • Login

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