Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
Localize default context menu for link labels
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.
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?
What OS are you running ?
Can you share the code where this is happening ?
I don't have access to this menu because I don't code it. It manages by the system.
You can try it by right clicking on any link label on Windows OS. I want to localize it (if possible).
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.
( around line 5577)
<message> <location line="+7"/> <source>Copy &Link Location</source> <translation>Kopiér l&ink</translation> </message>
I will try it. Thanks.
I have changed code and now it loads localization the same as my app localization. Thank you.
I have found that
qt_en.qmfile 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
How to get English localization? Thanks.
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.
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
MsgBoxbuttons and link label context menu still localized by previous loaded
Qtdefault language (in this case - Russian).
I think the only way is to rewrite all
MsgBoxand 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
Qtsource (English) translations.
I have figure it out. The problem was that I load
Qtdefault translation file in main function and don't remove translator there. So when I remove translator in
main.cppafter it was loaded, then I can change to English at runtime in for example
Test.cpp. Thank you.