Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Unsolved Qt id based translation

    General and Desktop
    3
    8
    1791
    Loading More Posts
    • 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.
    • V
      Valerian last edited by

      Is it possible to use id based translation for non-qt classes?

      1 Reply Last reply Reply Quote 0
      • P
        Paul Colby last edited by

        Hi @Valerian,

        You should be able to use QCoreApplication::translate directly to translate for any "context" (eg class name), regardless of whether or not its a Qt-based class. Though I'm not sure how that would work with Qt Linguist tools such as lupdate.

        Cheers.

        1 Reply Last reply Reply Quote 1
        • V
          Valerian last edited by

          Thanks @Paul
          Is there a way to use qtTrId() to translate string?

          1 Reply Last reply Reply Quote 0
          • P
            Paul Colby last edited by

            Is there a way to use qtTrId() to translate string?

            I don't see any reason why not, but I'm not at all familiar with Qt Linguist's Text ID Based Translations.

            I did notice this though:

            Note: You must use only plain-text-based or only text-ID-based functions in one application. If you mix them, you will end up with an incomplete set of texts to be translated.

            Cheers.

            1 Reply Last reply Reply Quote 3
            • V
              Valerian last edited by

              @Paul Thanks for the inputs.

              One more query, so when I change the language do I have to manually reset all the text in the application?

              mrjj 1 Reply Last reply Reply Quote 0
              • mrjj
                mrjj Lifetime Qt Champion @Valerian last edited by

                @Valerian
                Hi
                Yes for all Widgets not inserted via UI file,
                you must make a function that sets the texts again.
                Sadly its not live :)

                1 Reply Last reply Reply Quote 2
                • V
                  Valerian last edited by Valerian

                  How to refresh the QML files on installing a new translator using qsTrId()?

                  1 Reply Last reply Reply Quote 0
                  • V
                    Valerian last edited by

                    @Wieland any advice regarding updating the qml files on switching translators when using qsTrId approach?

                    1 Reply Last reply Reply Quote 0
                    • First post
                      Last post