updated -g to not replace jp translations

This commit is contained in:
argoneus 2020-05-16 13:15:58 +02:00 committed by Gitea
parent 5a9859cb56
commit 17dc031b9e

View file

@ -52,7 +52,7 @@ def translate_file(file_in, tsv_out_dir, json_out_dir, is_global):
) )
languages = ["jpn"] languages = ["jpn"]
if is_global: if is_global:
languages += ["enm", "zho", "kor"] languages = ["enm", "zho", "kor"]
json_output_paths = { json_output_paths = {
lang: os.path.join( lang: os.path.join(
json_out_dir, json_out_dir,
@ -70,9 +70,9 @@ def translate_file(file_in, tsv_out_dir, json_out_dir, is_global):
if e.errno != errno.EEXIST: if e.errno != errno.EEXIST:
raise raise
if not os.path.exists(os.path.dirname(json_output_paths["jpn"])): if not os.path.exists(os.path.dirname(json_output_paths[languages[0]])):
try: try:
os.makedirs(os.path.dirname(json_output_paths["jpn"])) os.makedirs(os.path.dirname(json_output_paths[languages[0]]))
except OSError as e: except OSError as e:
if e.errno != errno.EEXIST: if e.errno != errno.EEXIST:
raise raise