Skip to content

Commit

Permalink
fix: なんかja_jp.jsonにあるkeyの数がen_us.jsonにあるkeyの数より少ないmodが多々あるのでen_us.jso…
Browse files Browse the repository at this point in the history
…nをベースにし、ja_jp.jsonにkeyがある場合はそちらの値を使うように変更
  • Loading branch information
Y-RyuZU committed Oct 22, 2023
1 parent 3e7b47d commit 49bd81c
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -249,13 +249,14 @@ def process_jar_file(log_directory, jar_path, collected_map):

logging.info(f"Extract en_us.json or ja_jp.json in {jar_path / lang_path_in_jar}")
with zipfile.ZipFile(jar_path, 'r') as zip_ref:
if en_us_path_in_jar_str in zip_ref.namelist():
extract_specific_file(jar_path, en_us_path_in_jar_str, log_directory)
if ja_jp_path_in_jar_str in zip_ref.namelist():
extract_specific_file(jar_path, ja_jp_path_in_jar_str, log_directory)
elif en_us_path_in_jar_str in zip_ref.namelist():
extract_specific_file(jar_path, en_us_path_in_jar_str, log_directory)
os.rename(os.path.join(log_directory, en_us_path_in_jar), os.path.join(log_directory, ja_jp_path_in_jar))

en_us_path = os.path.join(log_directory, en_us_path_in_jar)
ja_jp_path = os.path.join(log_directory, ja_jp_path_in_jar)
extract_map_from_json(en_us_path, collected_map)
extract_map_from_json(ja_jp_path, collected_map)

def translate_from_jar(log_directory):
Expand Down

0 comments on commit 49bd81c

Please sign in to comment.