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. Localize default context menu for link labels

Localize default context menu for link labels

Scheduled Pinned Locked Moved Solved General and Desktop
13 Posts 3 Posters 3.5k 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.
  • Cobra91151C Offline
    Cobra91151C Offline
    Cobra91151
    wrote on last edited by Cobra91151
    #1

    Hi! In my application I have some link labels, when I right click on them I get default OS context menu. It's only localized by Qt and this localization is not the same as my app localization. Is there a way to localize this menu? Thanks in advance.

    1 Reply Last reply
    0
    • Cobra91151C Offline
      Cobra91151C Offline
      Cobra91151
      wrote on last edited by
      #2

      The problem is, I don't code this menu. It manages by the system (OS) and localized by Qt. Any ideas how to localize it?

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

        Hi,

        What OS are you running ?

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

        Cobra91151C 1 Reply Last reply
        0
        • SGaistS SGaist

          Hi,

          What OS are you running ?

          Cobra91151C Offline
          Cobra91151C Offline
          Cobra91151
          wrote on last edited by
          #4

          @SGaist

          On Windows.

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

            Can you share the code where this is happening ?

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

            Cobra91151C 1 Reply Last reply
            0
            • SGaistS SGaist

              Can you share the code where this is happening ?

              Cobra91151C Offline
              Cobra91151C Offline
              Cobra91151
              wrote on last edited by Cobra91151
              #6

              @SGaist

              I don't have access to this menu because I don't code it. It manages by the system.

              Screenshot:

              You can try it by right clicking on any link label on Windows OS. I want to localize it (if possible).

              mrjjM 1 Reply Last reply
              0
              • Cobra91151C Cobra91151

                @SGaist

                I don't have access to this menu because I don't code it. It manages by the system.

                Screenshot:

                You can try it by right clicking on any link label on Windows OS. I want to localize it (if possible).

                mrjjM Offline
                mrjjM Offline
                mrjj
                Lifetime Qt Champion
                wrote on last edited by mrjj
                #7

                @Cobra91151

                Hi
                Those texts are part of qt base languages.
                You can change the language by loading it in another translator than the one you are using for the app.
                https://wiki.qt.io/How_to_create_a_multi_language_application

                C:\Qt\5.7\Src\qttranslations\translations
                ( around line 5577)

                   <message>
                        <location line="+7"/>
                        <source>Copy &amp;Link Location</source>
                        <translation>Kopiér l&amp;ink</translation>
                    </message>
                

                alt text

                Cobra91151C 2 Replies Last reply
                2
                • mrjjM mrjj

                  @Cobra91151

                  Hi
                  Those texts are part of qt base languages.
                  You can change the language by loading it in another translator than the one you are using for the app.
                  https://wiki.qt.io/How_to_create_a_multi_language_application

                  C:\Qt\5.7\Src\qttranslations\translations
                  ( around line 5577)

                     <message>
                          <location line="+7"/>
                          <source>Copy &amp;Link Location</source>
                          <translation>Kopiér l&amp;ink</translation>
                      </message>
                  

                  alt text

                  Cobra91151C Offline
                  Cobra91151C Offline
                  Cobra91151
                  wrote on last edited by
                  #8

                  @mrjj

                  I will try it. Thanks.

                  1 Reply Last reply
                  0
                  • mrjjM mrjj

                    @Cobra91151

                    Hi
                    Those texts are part of qt base languages.
                    You can change the language by loading it in another translator than the one you are using for the app.
                    https://wiki.qt.io/How_to_create_a_multi_language_application

                    C:\Qt\5.7\Src\qttranslations\translations
                    ( around line 5577)

                       <message>
                            <location line="+7"/>
                            <source>Copy &amp;Link Location</source>
                            <translation>Kopiér l&amp;ink</translation>
                        </message>
                    

                    alt text

                    Cobra91151C Offline
                    Cobra91151C Offline
                    Cobra91151
                    wrote on last edited by
                    #9

                    @mrjj

                    I have changed code and now it loads localization the same as my app localization. Thank you.

                    1 Reply Last reply
                    1
                    • Cobra91151C Offline
                      Cobra91151C Offline
                      Cobra91151
                      wrote on last edited by Cobra91151
                      #10

                      Hi!

                      I have found that qt_en.qm file doesn't contain any localization data, and it only 1 KB size. Other languages are fine. So when loading this file I don't get any English Qt translations.

                      Screenshot:
                      Qt localization folder (default)

                      How to get English localization? Thanks.

                      mrjjM 1 Reply Last reply
                      0
                      • Cobra91151C Cobra91151

                        Hi!

                        I have found that qt_en.qm file doesn't contain any localization data, and it only 1 KB size. Other languages are fine. So when loading this file I don't get any English Qt translations.

                        Screenshot:
                        Qt localization folder (default)

                        How to get English localization? Thanks.

                        mrjjM Offline
                        mrjjM Offline
                        mrjj
                        Lifetime Qt Champion
                        wrote on last edited by
                        #11

                        @Cobra91151 said in Localize default context menu for link labels:

                        qt_en.qm

                        Hi the english is the in the source so this file does not contain anything.
                        I dont know if removing the translator will do it but its worth a shot.

                        Cobra91151C 2 Replies Last reply
                        1
                        • mrjjM mrjj

                          @Cobra91151 said in Localize default context menu for link labels:

                          qt_en.qm

                          Hi the english is the in the source so this file does not contain anything.
                          I dont know if removing the translator will do it but its worth a shot.

                          Cobra91151C Offline
                          Cobra91151C Offline
                          Cobra91151
                          wrote on last edited by Cobra91151
                          #12

                          @mrjj

                          I have tried to remove translator but it doesn't work. When I load English localization, it loads only my en files, not qt. And MsgBox buttons and link label context menu still localized by previous loaded Qt default language (in this case - Russian).

                          Screenshot:
                          alt text

                          I think the only way is to rewrite all MsgBox and translate all buttons text, load default Qt translation link label context menu (but it will not match with my app translation if it will be changed at runtime) or find a way to load Qt source (English) translations.

                          1 Reply Last reply
                          0
                          • mrjjM mrjj

                            @Cobra91151 said in Localize default context menu for link labels:

                            qt_en.qm

                            Hi the english is the in the source so this file does not contain anything.
                            I dont know if removing the translator will do it but its worth a shot.

                            Cobra91151C Offline
                            Cobra91151C Offline
                            Cobra91151
                            wrote on last edited by Cobra91151
                            #13

                            @mrjj

                            I have figure it out. The problem was that I load Qt default translation file in main function and don't remove translator there. So when I remove translator in main.cpp after it was loaded, then I can change to English at runtime in for example Test.cpp. Thank you.

                            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