Help,How to customize language of QtDragon's interface
- timaer
 - Offline
 - Premium Member
 - 
				
			 
		Less
		More
		
			
	
		- Posts: 82
 - Thank you received: 4
 
			
	
						28 May 2024 05:32				#301641
		by timaer
	
	
		
			
	
			
			 		
													
	
				Help,How to customize language of QtDragon's interface was created 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.
- andypugh
 - 
				
											 - Offline
 - Moderator
 - 
				
			 
		Less
		More
		
			
	
		- Posts: 19678
 - Thank you received: 4559
 
			
	
						28 May 2024 10:42				#301655
		by andypugh
	
	
		
			
	
	
			 		
													
	
				Replied by andypugh on topic Help,How to customize language of QtDragon's interface			
			
				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/
					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.
- MarkoPolo
 - Offline
 - Elite Member
 - 
				
			 
		Less
		More
		
			
	
		- Posts: 295
 - Thank you received: 79
 
			
	
						28 May 2024 12:22				#301668
		by MarkoPolo
	
	
		
			
	
	
			 		
													
	
				Replied by MarkoPolo on topic Help,How to customize language of QtDragon's interface			
			
				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
					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.
- andypugh
 - 
				
											 - Offline
 - Moderator
 - 
				
			 
		Less
		More
		
			
	
		- Posts: 19678
 - Thank you received: 4559
 
			
	
						28 May 2024 17:23				#301689
		by andypugh
	
	
		
			
				
Oh, so PyQt isn’t using Gettext?
					
	
			
			 		
													
	
				Replied by andypugh on topic Help,How to customize language of QtDragon's interface			
			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.
- timaer
 - Offline
 - Premium Member
 - 
				
			 
		Less
		More
		
			
	
		- Posts: 82
 - Thank you received: 4
 
			
	
						29 May 2024 03:18				#301723
		by timaer
	
	
		
			
	
			
			 		
													
	
				Replied by timaer on topic Help,How to customize language of QtDragon's interface			
			
				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.
- MarkoPolo
 - Offline
 - Elite Member
 - 
				
			 
		Less
		More
		
			
	
		- Posts: 295
 - Thank you received: 79
 
			
	
						30 May 2024 09:09				#301828
		by MarkoPolo
	
	
		
			
	
	
			 		
													
	
				Replied by MarkoPolo on topic Help,How to customize language of QtDragon's interface			
			
				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
					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.
- timaer
 - Offline
 - Premium Member
 - 
				
			 
		Less
		More
		
			
	
		- Posts: 82
 - Thank you received: 4
 
			
	
						01 Jun 2024 01:59				#302027
		by timaer
	
	
		
			
	
			
			 		
													
	
				Replied by timaer on topic Help,How to customize language of QtDragon's interface			
			
				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.
- MarkoPolo
 - Offline
 - Elite Member
 - 
				
			 
		Less
		More
		
			
	
		- Posts: 295
 - Thank you received: 79
 
			
	
						01 Jun 2024 18:28				#302087
		by MarkoPolo
	
	
		
			
				
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.
					
	
	
			 		
													
	
				Replied by MarkoPolo on topic Help,How to customize language of QtDragon's interface			
			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.
- cmorley
 - Offline
 - Moderator
 - 
				
			 
		Less
		More
		
			
	
		- Posts: 7230
 - Thank you received: 2106
 
			
	
						02 Jun 2024 02:12				#302116
		by cmorley
	
	
		
			
	
	
			 		
													
	
				Replied by cmorley on topic Help,How to customize language of QtDragon's interface			
			
				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.
- timaer
 - Offline
 - Premium Member
 - 
				
			 
		Less
		More
		
			
	
		- Posts: 82
 - Thank you received: 4
 
			
	
						03 Jun 2024 01:23				#302209
		by timaer
	
	
		
			
	
			
			 		
													
	
				Replied by timaer on topic Help,How to customize language of QtDragon's interface			
			
				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.246 seconds