|  |  | @ -1,4 +1,5 @@ | 
			
		
	
		
		
			
				
					
					|  |  |  | import os |  |  |  | import os | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | import json | 
			
		
	
		
		
			
				
					
					|  |  |  | Import('qt_env', 'arch', 'common', 'messaging', 'visionipc', |  |  |  | Import('qt_env', 'arch', 'common', 'messaging', 'visionipc', | 
			
		
	
		
		
			
				
					
					|  |  |  |        'cereal', 'transformations') |  |  |  |        'cereal', 'transformations') | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
	
		
		
			
				
					|  |  | @ -67,11 +68,18 @@ if GetOption('test'): | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  | # build translation files |  |  |  | # build translation files | 
			
		
	
		
		
			
				
					
					|  |  |  | translation_sources = Glob("#selfdrive/ui/translations/*.ts", strings=True) |  |  |  | with open(File("translations/languages.json").abspath) as f: | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |   languages = json.loads(f.read()) | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | translation_sources = [f"#selfdrive/ui/translations/{l}.ts" for l in languages.values()] | 
			
		
	
		
		
			
				
					
					|  |  |  | translation_targets = [src.replace(".ts", ".qm") for src in translation_sources] |  |  |  | translation_targets = [src.replace(".ts", ".qm") for src in translation_sources] | 
			
		
	
		
		
			
				
					
					|  |  |  | lrelease = 'third_party/qt5/larch64/bin/lrelease' if arch == 'larch64' else 'lrelease' |  |  |  | lrelease_bin = 'third_party/qt5/larch64/bin/lrelease' if arch == 'larch64' else 'lrelease' | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  | qt_env.Command(translation_targets, translation_sources, f"{lrelease} $SOURCES") |  |  |  | 
 | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | lupdate = qt_env.Command(translation_sources, qt_src, "selfdrive/ui/update_translations.py") | 
			
				
				
			
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | lrelease = qt_env.Command(translation_targets, translation_sources, f"{lrelease_bin} $SOURCES") | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | qt_env.Depends(lrelease, lupdate) | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | qt_env.NoClean(translation_sources) | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | qt_env.Precious(translation_sources) | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | qt_env.NoCache(lupdate) | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  | # setup and factory resetter |  |  |  | # setup and factory resetter | 
			
		
	
		
		
			
				
					
					|  |  |  | if GetOption('extras'): |  |  |  | if GetOption('extras'): | 
			
		
	
	
		
		
			
				
					|  |  | 
 |