Help,How to customize language of QtDragon's interface

More
2 years 5 months ago #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 to join the conversation.

More
2 years 5 months ago #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/

Please Log in to join the conversation.

More
2 years 5 months ago #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

Please Log in to join the conversation.

More
2 years 5 months ago #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 to join the conversation.

More
2 years 5 months ago #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 to join the conversation.

More
2 years 5 months ago #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

Please Log in to join the conversation.

More
2 years 4 months ago #302027 by timaer
Thanks a lot ,I'm going to translate the string in the qtdragon.ui.

Please Log in to join the conversation.

More
2 years 4 months ago #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.

Please Log in to join the conversation.

More
2 years 4 months ago #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 :)

Please Log in to join the conversation.

More
2 years 4 months ago #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 to join the conversation.

Time to create page: 0.052 seconds
Powered by Kunena Forum