Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Multiple language with database in runtime in Qt
Forum Updated to NodeBB v4.3 + New Features

Multiple language with database in runtime in Qt

Scheduled Pinned Locked Moved Solved General and Desktop
4 Posts 2 Posters 326 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.
  • KaguroK Offline
    KaguroK Offline
    Kaguro
    wrote on last edited by
    #1

    Hi Guys!
    My question may not be organically related to QT (of course, partly it does because I want to solve it with QT)
    How would you start an application where you can change the language on run time? So, an application that does not require restarting.
    (I would like it in the form of a dictionary, I do not want QT to translate the texts).
    I saw solutions to this in an example with language files, but I could not make it to translate the value in the variable to what I specified in the file.
    Besides, there is also the database, from which I expose some data as text on the screen. How would it be worth doing the database for this? How can I use the database in QT to convert its text at run time?
    Thank you in advance for your ideas and answers!

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

      Hi,

      Qt's translation system uses QTranslator for it's magic. If you want to do something 100% custom then you need to mimic that and use for example a custom event for which you will trigger update to all the texts on your widget like shown in the Dynamic Translation chapter.

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

      KaguroK 1 Reply Last reply
      2
      • SGaistS SGaist

        Hi,

        Qt's translation system uses QTranslator for it's magic. If you want to do something 100% custom then you need to mimic that and use for example a custom event for which you will trigger update to all the texts on your widget like shown in the Dynamic Translation chapter.

        KaguroK Offline
        KaguroK Offline
        Kaguro
        wrote on last edited by
        #3

        @SGaist Ty! I solved the problem :)

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

          You're welcome !

          Can you share what you did ? :-)

          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
          0

          • Login

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