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. Querying the currently-installed QTranslators, to use QCoreApplication::removeTranslator()?

Querying the currently-installed QTranslators, to use QCoreApplication::removeTranslator()?

Scheduled Pinned Locked Moved Solved General and Desktop
3 Posts 2 Posters 685 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.
  • FeRDNYCF Offline
    FeRDNYCF Offline
    FeRDNYC
    wrote on last edited by
    #1

    I see in the Qt documentation that translations can be removed from the application with QCoreApplication::removeTranslator(). However, that method takes a QTranslator object representing the translator to be removed, which in our application is not currently persisted beyond the loading phase.

    Is there any way to get a list of the installed QTranslators, in order to remove some/all of them? Or do we need to store every QTranslator object loaded, if we want to be able to later unload any of them?

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

      Hi and welcome to devnet,

      From a quick look at QCoreApplication sources, no, there's no API to access the list of active translators.

      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
      3
      • FeRDNYCF Offline
        FeRDNYCF Offline
        FeRDNYC
        wrote on last edited by
        #3

        Thanks for the reply, @SGaist , I'd come to the same conclusion but it's good to have confirmation from more-experienced eyes.

        In the end, I just completely reworked the logic for loading translations so that, hopefully, we only load what we need and there's never any need to unload them. (We're not doing Dynamic Translation anyway, the user is prompted to restart the application when they change languages.)

        1 Reply Last reply
        1

        • Login

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