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. Translation - Which qm file loaded ?
Forum Updated to NodeBB v4.3 + New Features

Translation - Which qm file loaded ?

Scheduled Pinned Locked Moved Unsolved General and Desktop
5 Posts 4 Posters 462 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.
  • dheerendraD Offline
    dheerendraD Offline
    dheerendra
    Qt Champions 2022
    wrote on last edited by
    #1

    Hi

    Is there any Qt API to find which qm(lang translation file) is loaded ?

    Dheerendra
    @Community Service
    Certified Qt Specialist
    http://www.pthinks.com

    Christian EhrlicherC J.HilkJ 2 Replies Last reply
    0
    • dheerendraD dheerendra

      Hi

      Is there any Qt API to find which qm(lang translation file) is loaded ?

      Christian EhrlicherC Offline
      Christian EhrlicherC Offline
      Christian Ehrlicher
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @dheerendra said in Translation - Which qm file loaded ?:

      Is there any Qt API to find which qm(lang translation file) is loaded ?

      No, you have to remember it by yourself.

      Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
      Visit the Qt Academy at https://academy.qt.io/catalog

      1 Reply Last reply
      1
      • VRoninV Offline
        VRoninV Offline
        VRonin
        wrote on last edited by VRonin
        #3

        I'm not sure it make much sense, you normally have more than one loaded at any time (at least qt_*.qm and myApp_*.qm)

        "La mort n'est rien, mais vivre vaincu et sans gloire, c'est mourir tous les jours"
        ~Napoleon Bonaparte

        On a crusade to banish setIndexWidget() from the holy land of Qt

        1 Reply Last reply
        1
        • dheerendraD dheerendra

          Hi

          Is there any Qt API to find which qm(lang translation file) is loaded ?

          J.HilkJ Offline
          J.HilkJ Offline
          J.Hilk
          Moderators
          wrote on last edited by
          #4

          @dheerendra QTranslator should have the filePath function:

          QString QTranslator::filePath() const

          usually the translation files you load have a country/language specific identifier. qt_en.qm for example

          should be easy enough to conclude what file/language was loaded :D


          Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


          Q: What's that?
          A: It's blue light.
          Q: What does it do?
          A: It turns blue.

          1 Reply Last reply
          2
          • dheerendraD Offline
            dheerendraD Offline
            dheerendra
            Qt Champions 2022
            wrote on last edited by
            #5

            @J-Hilk @Christian-Ehrlicher @VRonin
            Thanks for the reply. I appreciate the same. I have done few work-arounds to get the information. My interest was to find through some API if exists.

            Dheerendra
            @Community Service
            Certified Qt Specialist
            http://www.pthinks.com

            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