File tree Expand file tree Collapse file tree 2 files changed +51
-0
lines changed
Expand file tree Collapse file tree 2 files changed +51
-0
lines changed Original file line number Diff line number Diff line change 1+ """
2+ This Script searches for missing entries in a given localization lua-file,
3+ comparing its contents to en-us.lua.
4+
5+ Author: Avery (@onichama)
6+ """
7+
8+ vars_en = []
9+ vars_other = []
10+
11+ def read_vars_from_file (filename , into_list ):
12+ with open (filename ) as file_en :
13+ for line in file_en :
14+ if " = {" in line and "text = {" not in line and "unlock = {" not in line :
15+ into_list .append (line .split (" = {" )[0 ].strip ())
16+
17+ read_vars_from_file ("../en-us.lua" , vars_en ) # Take EN-US as base language
18+ read_vars_from_file ("../de.lua" , vars_other ) # Change this to the language you want to compare to
19+
20+ for var in vars_en :
21+ if var not in vars_other :
22+ print (var )
Original file line number Diff line number Diff line change 1+ """
2+ This Script searches for missing entries in a given localization lua-file,
3+ comparing its contents to en-us.lua.
4+ This version also gives the full "path" to a given entry, and can detect
5+ stuff like missing unlock descriptors.
6+
7+ Author: Avery (@onichama)
8+ """
9+
10+ vars_en = []
11+ vars_other = []
12+
13+ def read_vars_from_file (filename , into_list ):
14+ current_var_path = []
15+ with open (filename ) as file_en :
16+ for line in file_en :
17+ if " = {" in line :
18+ current_var = line .split (" = {" )[0 ].strip ()
19+ current_var_path .append (current_var )
20+ into_list .append ("." .join (current_var_path ))
21+ if ("},\n " in line or "}\n " in line ) and len (current_var_path ) > 0 :
22+ current_var_path .pop (len (current_var_path )- 1 )
23+
24+ read_vars_from_file ("../en-us.lua" , vars_en ) # Take EN-US as base language
25+ read_vars_from_file ("../de.lua" , vars_other ) # Change this to the language you want to compare to
26+
27+ for var in vars_en :
28+ if var not in vars_other :
29+ print (var )
You can’t perform that action at this time.
0 commit comments