restructure
This commit is contained in:
20
tools/copy_localization_lines.py
Normal file
20
tools/copy_localization_lines.py
Normal file
@@ -0,0 +1,20 @@
|
||||
import vdf
|
||||
import sys
|
||||
|
||||
def main(english_keyfile: str, chinese_keyfile: str, output_file: str):
|
||||
chinese = vdf.load(open(chinese_keyfile, encoding='utf-16-le'), mapper=vdf.VDFDict)['lang']['Tokens']
|
||||
english = vdf.load(open(english_keyfile), mapper=vdf.VDFDict)['lang']['Tokens']
|
||||
output = vdf.VDFDict()
|
||||
output['lang'] = vdf.VDFDict()
|
||||
output['lang']['Language'] = "english"
|
||||
output['lang']['Tokens'] = vdf.VDFDict()
|
||||
output_tokens = output['lang']['Tokens']
|
||||
for key in chinese:
|
||||
#print(key)
|
||||
if key in english.keys():
|
||||
output_tokens[key] = english[key]
|
||||
else:
|
||||
output_tokens[key] = chinese[key]
|
||||
vdf.dump(output, open(output_file, 'w'),pretty=True)
|
||||
args = sys.argv[1:]
|
||||
main(args[0], args[1], args[2])
|
||||
Reference in New Issue
Block a user