mirror of
https://github.com/LibreTranslate/LibreTranslate.git
synced 2025-05-04 20:30:39 +00:00
Update locales
This commit is contained in:
parent
9032d245dc
commit
6c796b6f03
74 changed files with 4766 additions and 3460 deletions
|
@ -66,10 +66,11 @@ if __name__ == "__main__":
|
|||
'zt': 'zh_Hant'
|
||||
}
|
||||
lang_codes = [lang_map.get(l.code, l.code) for l in languages if l.code != "en"]
|
||||
all_folders = [d for d in os.listdir(locales_dir) if os.path.isdir(os.path.join(locales_dir, d))]
|
||||
review_map = {}
|
||||
|
||||
# Init/update
|
||||
for l in lang_codes:
|
||||
for l in all_folders:
|
||||
cmd = "init"
|
||||
if os.path.isdir(os.path.join(locales_dir, l, "LC_MESSAGES")):
|
||||
cmd = "update"
|
||||
|
@ -82,7 +83,7 @@ if __name__ == "__main__":
|
|||
if not os.path.isfile(meta_file):
|
||||
with open(meta_file, 'w') as f:
|
||||
f.write(json.dumps({
|
||||
'name': next(lang.name for lang in languages if lang_map.get(lang.code, lang.code) == l),
|
||||
'name': l if l not in lang_codes else next(lang.name for lang in languages if lang_map.get(lang.code, lang.code) == l),
|
||||
'reviewed': False
|
||||
}, indent=4))
|
||||
print("Wrote %s" % meta_file)
|
||||
|
@ -96,7 +97,6 @@ if __name__ == "__main__":
|
|||
# when a language model is available and a string is empty
|
||||
|
||||
locales = get_available_locale_codes(only_reviewed=False)
|
||||
print(locales)
|
||||
for locale in locales:
|
||||
if locale == 'en':
|
||||
continue
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue