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. Why is there no way to obtain a list of translators?
Forum Updated to NodeBB v4.3 + New Features

Why is there no way to obtain a list of translators?

Scheduled Pinned Locked Moved Unsolved General and Desktop
11 Posts 4 Posters 648 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.
  • P Offline
    P Offline
    pasabanov
    wrote on last edited by
    #1

    QCoreApplication stores a list of translators (QTranslator) that have been installed. Why is it not possible to access them?
    It would be very convenient.

    Christian EhrlicherC 1 Reply Last reply
    0
    • P pasabanov

      QCoreApplication stores a list of translators (QTranslator) that have been installed. Why is it not possible to access them?
      It would be very convenient.

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

      What's the use-case?

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

      P 1 Reply Last reply
      0
      • Christian EhrlicherC Christian Ehrlicher

        What's the use-case?

        P Offline
        P Offline
        pasabanov
        wrote on last edited by
        #3

        @Christian-Ehrlicher For example, I want to implement logic for loading and removing translators at the user's discretion.
        In this case, I would need to declare an additional variable for the list of translators.
        Although the same problem could be easily solved if QCoreApplication had a method translators().

        It's not a big deal. It's just about doing unnecessary work and overcomplicating the code.

        JonBJ Christian EhrlicherC 2 Replies Last reply
        0
        • P pasabanov

          @Christian-Ehrlicher For example, I want to implement logic for loading and removing translators at the user's discretion.
          In this case, I would need to declare an additional variable for the list of translators.
          Although the same problem could be easily solved if QCoreApplication had a method translators().

          It's not a big deal. It's just about doing unnecessary work and overcomplicating the code.

          JonBJ Offline
          JonBJ Offline
          JonB
          wrote on last edited by
          #4

          @pasabanov https://forum.qt.io/topic/20676/list-of-tranlatros-in-qapplication

          P 1 Reply Last reply
          0
          • P pasabanov

            @Christian-Ehrlicher For example, I want to implement logic for loading and removing translators at the user's discretion.
            In this case, I would need to declare an additional variable for the list of translators.
            Although the same problem could be easily solved if QCoreApplication had a method translators().

            It's not a big deal. It's just about doing unnecessary work and overcomplicating the code.

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

            So you just have to remember your one QTranslator object pointer which you have to delete also by yourself later on since QCoreApplication does not take ownership of it.

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

            P 1 Reply Last reply
            0
            • JonBJ JonB

              @pasabanov https://forum.qt.io/topic/20676/list-of-tranlatros-in-qapplication

              P Offline
              P Offline
              pasabanov
              wrote on last edited by
              #6

              @JonB I know that there is no such method. I'm just asking why.

              JonBJ 1 Reply Last reply
              0
              • P pasabanov

                @JonB I know that there is no such method. I'm just asking why.

                JonBJ Offline
                JonBJ Offline
                JonB
                wrote on last edited by
                #7

                @pasabanov
                I would suggest as @Christian-Ehrlicher says: simply (lack of) big use case + ease of counting it yourself if you really want to. There isn't some deep reason why Qt might expose some method and not another, they just wrote it and it came out like it has.

                P 1 Reply Last reply
                0
                • Christian EhrlicherC Christian Ehrlicher

                  So you just have to remember your one QTranslator object pointer which you have to delete also by yourself later on since QCoreApplication does not take ownership of it.

                  P Offline
                  P Offline
                  pasabanov
                  wrote on last edited by
                  #8

                  @Christian-Ehrlicher there might be more than one translator installed at a time. So I need to keep the full list of translators.

                  Christian EhrlicherC 1 Reply Last reply
                  0
                  • P pasabanov

                    @Christian-Ehrlicher there might be more than one translator installed at a time. So I need to keep the full list of translators.

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

                    So you already have to maintain the loaded and unloaded translator instances including some additional stuff by yourself to present it to your user. How should a list of QTranslator instances currently active really help here?

                    Feel free to provide a patch including a minimal use-case to the qt bug reporting system if you really think this is such a common use-case that it has to be added to Qt.

                    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
                    0
                    • JonBJ JonB

                      @pasabanov
                      I would suggest as @Christian-Ehrlicher says: simply (lack of) big use case + ease of counting it yourself if you really want to. There isn't some deep reason why Qt might expose some method and not another, they just wrote it and it came out like it has.

                      P Offline
                      P Offline
                      pasabanov
                      wrote on last edited by
                      #10

                      @JonB so why don't they implement this now? It's so simple yet convenient. And it won't cause any conflicts with previous versions.

                      SGaistS 1 Reply Last reply
                      0
                      • P pasabanov

                        @JonB so why don't they implement this now? It's so simple yet convenient. And it won't cause any conflicts with previous versions.

                        SGaistS Offline
                        SGaistS Offline
                        SGaist
                        Lifetime Qt Champion
                        wrote on last edited by
                        #11

                        @pasabanov As already stated by my fellows: not enough demands for that use case.

                        Adding new APIs that only a few people make use of also means bloating the interface and code base for all others and it's also more code to maintain.

                        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