mirror of
https://github.com/RVC-Project/Retrieval-based-Voice-Conversion-WebUI.git
synced 2024-12-29 19:15:04 +08:00
fix locale_diff.py
This commit is contained in:
parent
73627d22bb
commit
cffdce2097
@ -3,10 +3,10 @@ import os
|
||||
from collections import OrderedDict
|
||||
|
||||
# Define the standard file name
|
||||
standard_file = "zh_CN.json"
|
||||
standard_file = "i18n/locale/zh_CN.json"
|
||||
|
||||
# Find all JSON files in the directory
|
||||
dir_path = "i18n/locale"
|
||||
dir_path = "i18n/locale/"
|
||||
languages = [
|
||||
f for f in os.listdir(dir_path) if f.endswith(".json") and f != standard_file
|
||||
]
|
||||
@ -18,7 +18,7 @@ with open(standard_file, "r", encoding="utf-8") as f:
|
||||
# Loop through each language file
|
||||
for lang_file in languages:
|
||||
# Load the language file
|
||||
with open(lang_file, "r", encoding="utf-8") as f:
|
||||
with open(dir_path + lang_file, "r", encoding="utf-8") as f:
|
||||
lang_data = json.load(f, object_pairs_hook=OrderedDict)
|
||||
|
||||
# Find the difference between the language file and the standard file
|
||||
@ -40,6 +40,6 @@ for lang_file in languages:
|
||||
)
|
||||
|
||||
# Save the updated language file
|
||||
with open(lang_file, "w", encoding="utf-8") as f:
|
||||
with open(dir_path + lang_file, "w", encoding="utf-8") as f:
|
||||
json.dump(lang_data, f, ensure_ascii=False, indent=4, sort_keys=True)
|
||||
f.write("\n")
|
||||
|
Loading…
Reference in New Issue
Block a user