Help,How to customize language of QtDragon's interface

More
28 May 2024 05:32 #301641 by timaer
Hi,everyone ,is there any way to customize the language of the QtDragon's interface,e.g I want to make it to Chinese,such as button text,how to make it ?Appreciate for any comments.Thanks .

Please Log in or Create an account to join the conversation.

More
28 May 2024 10:42 #301655 by andypugh
Most of the user interfaces are multilingual, if you change the locale on your computer, the user interface should change.

If some or all of QtDragon is not translated then you can help the project by translating:
hosted.weblate.org/projects/linuxcnc/
The following user(s) said Thank You: timaer

Please Log in or Create an account to join the conversation.

More
28 May 2024 12:22 #301668 by MarkoPolo
If you want to change the text of individual keys, you can do so in the qss theme file
e.g.
#action_mist{
    qproperty-true_state_string: "空气\\nOn";
    qproperty-false_state_string: "空气\\nOff";
}

linuxcnc.org/docs/devel/html/gui/qtdragon.html
The following user(s) said Thank You: timaer

Please Log in or Create an account to join the conversation.

More
28 May 2024 17:23 #301689 by andypugh

If you want to change the text of individual keys, you can do so in the qss theme file


Oh, so PyQt isn’t using Gettext?

Please Log in or Create an account to join the conversation.

More
29 May 2024 03:18 #301723 by timaer
Thank you for telling me the way to modify the text in QtDragon interface. Through this way looks to requre knowing all the widget names,and if I want to modify all the QtDragon's interface 'text to Chinese ,it seems a lot of work to do :(

Please Log in or Create an account to join the conversation.

More
30 May 2024 09:09 #301828 by MarkoPolo
As far as I know, it doesn't use gettext and qtdragon is not translated.
I guess the only option left is to replace words in the theme file.
You can view the widget names by opening qtdragon.ui in QtDesigner
The following user(s) said Thank You: timaer

Please Log in or Create an account to join the conversation.

More
01 Jun 2024 01:59 #302027 by timaer
Thanks a lot ,I'm going to translate the string in the qtdragon.ui.

Please Log in or Create an account to join the conversation.

More
01 Jun 2024 18:28 #302087 by MarkoPolo

Thanks a lot ,I'm going to translate the string in the qtdragon.ui.



You can do this, but it has some drawbacks. After each update, you will lose all your work.
Moreover, some words are set by the handler file. See qtdragon_handler.py.
If you do this in the theme file and save the file under your own name, there will be no such problems.
The following user(s) said Thank You: timaer

Please Log in or Create an account to join the conversation.

More
02 Jun 2024 02:12 #302116 by cmorley
If you are using the master branch, I have added code for translation ability to QtDrgaon/hd, using the same process as QtPlamac - I basically copied there code/docs :)
The following user(s) said Thank You: tommylight, snowgoer540, timaer

Please Log in or Create an account to join the conversation.

More
03 Jun 2024 01:23 #302209 by timaer
Hi,I indeed found the string is both in ui and py file ,not so convinient .Thanks for your good advice,using theme file may be a better choice.

Please Log in or Create an account to join the conversation.

Moderators: cmorley
Time to create page: 0.109 seconds
Powered by Kunena Forum