mirror of
https://github.com/open-goal/jak-project
synced 2026-08-21 23:00:45 -04:00
New Crowdin updates - February 2024 (#3857)
This commit is contained in:
@@ -0,0 +1,86 @@
|
||||
# autoglottonyms are the way the native speakers refer to their language
|
||||
# they should be left alone and not translated, ever accidentally change your language and then struggle to find it
|
||||
# in the list because you don't know how to say "English" in, lets say, french ("anglais").
|
||||
#
|
||||
# yeah thats why you leave em alone, this script makes sure that remains true.
|
||||
|
||||
import argparse
|
||||
import glob
|
||||
import json
|
||||
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument("--fix", action="store_true")
|
||||
parser.set_defaults(fix=False)
|
||||
args = parser.parse_args()
|
||||
|
||||
JAK1_AUTOGLOT_IDS = [
|
||||
"1110",
|
||||
"1111",
|
||||
"1112",
|
||||
"1113",
|
||||
"1114",
|
||||
"1115",
|
||||
"1116",
|
||||
"1117",
|
||||
"1118",
|
||||
"1119",
|
||||
"111a",
|
||||
"111b",
|
||||
"111c",
|
||||
"111d",
|
||||
"111e",
|
||||
"111f",
|
||||
]
|
||||
JAK2_AUTOGLOT_IDS = [
|
||||
"133a",
|
||||
"133c",
|
||||
"133d",
|
||||
"133e",
|
||||
"133f",
|
||||
"1340",
|
||||
"1341",
|
||||
"1342",
|
||||
"1343",
|
||||
"1344",
|
||||
"1345",
|
||||
"1346",
|
||||
"1347",
|
||||
"1348",
|
||||
"1349",
|
||||
]
|
||||
|
||||
def check_text_files(game_name, ids_to_check):
|
||||
problem_found = False
|
||||
|
||||
english_file = "./game/assets/{}/text/game_custom_text_en-US.json".format(game_name)
|
||||
with open(english_file, encoding="utf-8") as f:
|
||||
english_data = json.load(f)
|
||||
|
||||
# Iterate through the translations making sure there are no characters that are not allowed
|
||||
text_files = glob.glob("./game/assets/{}/text/*.json".format(game_name))
|
||||
|
||||
for text_file in text_files:
|
||||
print("Checking {}".format(text_file))
|
||||
with open(text_file, encoding="utf-8") as f:
|
||||
file_data = json.load(f)
|
||||
for id in ids_to_check:
|
||||
if id in file_data and english_data[id] != file_data[id]:
|
||||
print("{} doesn't match english file".format(id))
|
||||
problem_found = True
|
||||
if args.fix:
|
||||
file_data[id] = english_data[id]
|
||||
if args.fix:
|
||||
# save the modified file back out
|
||||
with open(text_file, "w", encoding="utf-8") as f:
|
||||
json.dump(file_data, f, indent=2, ensure_ascii=False)
|
||||
f.write("\n")
|
||||
return problem_found
|
||||
|
||||
not_ok_jak1 = check_text_files("jak1", JAK1_AUTOGLOT_IDS)
|
||||
not_ok_jak2 = check_text_files("jak2", JAK2_AUTOGLOT_IDS)
|
||||
|
||||
if not_ok_jak1 or not_ok_jak2:
|
||||
print("Autoglottonyms were changed, stop!")
|
||||
exit(1)
|
||||
else:
|
||||
print("Autoglottonyms were left alone!")
|
||||
@@ -18,7 +18,7 @@ JAK1_ALLOWED_CHARACTERS = [
|
||||
"0", "1", "2", "3", "4", "5", "6", "7", "8", "9",
|
||||
"'", "!", "(", ")", "+", "-", ",", ".", "/", ":", "=", "<", ">", "*", "%", "?", "\"",
|
||||
"`", "ˇ", "¨", "º", "¡", "¿", "Æ", "Ç", "ß", "™", "、", " ", "Å", "Ø", "Ą", "Ę", "Ł", "Ż","Ů", "Ý", "Č", "Ň", "Ř", "Š", "Ť", "Ž",
|
||||
"Ñ", "Ã", "Õ", "Á", "É", "Í", "Ó", "Ú", "Ć", "Ń", "Ś", "Ź", "Ő", "Ű", "Â", "Ê", "Î", "Ô", "Û", "À", "È", "Ì", "Ò", "Ù", "Ä", "Ë", "Ï", "Ö", "ö", "Ü", "Ė","Č","Š","Ž","Ų","Ū","Į","Ǎ","Ě","Ǧ","Ǐ","Ǒ","Ǔ","Y̌",
|
||||
"Ñ", "Ã", "Õ", "Á", "É", "Í", "Ó", "Ú", "Ć", "Ń", "Ś", "Ź", "Ő", "Ű", "Â", "Đ", "Ê", "Î", "Ô", "Û", "À", "È", "Ì", "Ò", "Ù", "Ä", "Ë", "Ï", "Ö", "ö", "Ü", "Ė","Č","Š","Ž","Ų","Ū","Į","Ǎ","Ě","Ǧ","Ǐ","Ǒ","Ǔ","Y̌",
|
||||
"海", "界", "学", "ワ", "ヲ", "ン", "岩", "旧", "空", "ヮ", "撃", "賢", "湖", "口", "行", "合", "士", "寺", "山", "者", "所", "書", "小", "沼", "上", "城", "場", "出", "闇", "遺", "黄", "屋", "下", "家", "火", "花", "レ", "ロ", "青", "・", "゛", "゜", "ー", "『", "』", "宝", "石", "赤", "跡", "川", "戦", "村", "隊", "台", "長", "鳥", "艇", "洞", "道", "発", "飛", "噴", "池", "中", "塔", "島", "部", "砲", "産", "眷", "力", "緑", "岸", "像", "谷", "心", "森", "水", "船", "世",
|
||||
"ぁ", "あ", "ぃ", "い", "ぅ", "う", "ぇ", "え", "ぉ", "お", "か", "き", "く", "け", "こ", "さ", "し", "す", "せ", "そ", "た", "ち", "っ", "つ", "て", "と", "な", "に", "ぬ", "ね", "の", "は", "ひ", "ふ", "へ", "ほ", "ま", "み", "む", "め", "も", "ゃ", "や", "ゅ", "ゆ", "ょ", "よ", "ら", "り", "る", "れ", "ろ", "ゎ", "わ", "を", "ん",
|
||||
"が", "ぎ", "ぐ", "げ", "ご", "ざ", "じ", "ず", "ぜ", "ぞ", "だ", "ぢ", "づ", "で", "ど", "ば", "び", "ぶ", "べ", "ぼ",
|
||||
@@ -60,7 +60,7 @@ JAK2_ALLOWED_CHARACTERS = [
|
||||
"0", "1", "2", "3", "4", "5", "6", "7", "8", "9",
|
||||
"'", "!", "(", ")", "+", "-", ",", ".", "/", ":", "=", "<", ">", "*", "%", "?", "\"",
|
||||
"`", "ˇ", "¨", "º", "¡", "¿", "Æ", "Ç", "ß", "™", "、", " ", "Å", "Ø", "Ą", "Ę", "Ł", "Ż",
|
||||
"Ů", "ů", "Ý", "ý", "Č", "č", "Ň", "ň", "Ř", "ř", "Š", "š", "Ť", "ť", "Ž", "ž",
|
||||
"Ů", "ů", "Ý", "ý", "Č", "č", "Ň", "ň", "Ř", "ř", "Š", "š", "Ť", "ť", "Ž", "ž", "Đ", "đ",
|
||||
"æ", "ø", "œ",
|
||||
"Ñ", "Ã", "Õ", "Á", "É", "Í", "Ó", "Ú", "Ć", "Ń", "Ś", "Ź", "ź", "Ő", "Ű", "Â", "Ê", "Î", "Ô", "Û", "À", "È", "Ì", "Ò", "Ù", "Ä", "Ë", "Ï", "ï", "Ö", "ö", "Ü", "Ė","Č","Š","Ž","Ų","Ū","Į",
|
||||
"ñ", "á", "é", "í", "ó", "ú", "â", "ê", "î", "ô", "û", "à", "è", "ì", "ò", "ù", "ä", "ö", "ü", "ś", "å", "õ", "ã", "ę", "ż", "ć", "ą", "ł", "ń", "ű", "ő", "ė","č","š","ž","ų","ū","į",
|
||||
|
||||
Reference in New Issue
Block a user