diff --git a/.github/scripts/localizationChecker.py b/.github/scripts/localizationChecker.py index 3ec7dc77..64b1bd53 100644 --- a/.github/scripts/localizationChecker.py +++ b/.github/scripts/localizationChecker.py @@ -62,7 +62,7 @@ def addUpdatedTables(languageCode, dlc): updatedTables += ["abyssSynergies", "horsepills", "tarotClothBuffs", "bookOfVirtuesWisps", "goldenTrinketEffects"] # korean uses some additional addititve tables - if languageCode == "ko": + if languageCode == "ko_kr": if dlc == "rep": updatedTables += ["dice", "MCM"] else: @@ -109,19 +109,19 @@ def compare_tables(table1, table2, prev_key): languageProgress = {} -en_entries = {} +english_entries = {} for dlc in dlcs: lua.execute('REPENTOGON = true; EID = {}; EID.descriptions = {}; function EID:updateDescriptionsViaTable(changeTable, tableToUpdate) for k,v in pairs(changeTable) do if v == "" then tableToUpdate[k] = nil else tableToUpdate[k] = v end end end') g = lua.globals() - addUpdatedTables("en", dlc) + addUpdatedTables("en_us", dlc) # Read English language files first - englishFile = glob.glob(SOURCE_MOD_DIRECTORY+"/**/"+dlc+"/en.lua", recursive=True)[0] + englishFile = glob.glob(SOURCE_MOD_DIRECTORY+"/**/"+dlc+"/en_us.lua", recursive=True)[0] print("reading:", englishFile) lua.execute(open(englishFile, "r", encoding="UTF-8").read()) - en_entries[dlc] = count_entries(g.EID['descriptions']['en']) - print("English "+dlc+" entries:", en_entries[dlc]) + english_entries[dlc] = count_entries(g.EID['descriptions']['en_us']) + print("English "+dlc+" entries:", english_entries[dlc]) langFiles = [] @@ -131,7 +131,7 @@ for dlc in dlcs: langFiles += glob.glob(SOURCE_MOD_DIRECTORY+"/**/"+dlc+"/*.lua", recursive=True) # Read other language files for file in langFiles: - if "en" not in file and "transformations" not in file: + if "en_us" not in file and "transformations" not in file: languageCode = os.path.basename(file).replace(".lua","") print("reading:",file) addUpdatedTables(languageCode, dlc) @@ -141,16 +141,16 @@ for dlc in dlcs: # Evaluate language for completeness print(f"Evaluating language '{languageCode}'..") - errorCount = compare_tables(g.EID['descriptions']["en"], g.EID['descriptions'][languageCode], languageCode+"("+dlc+")") - percentage = (en_entries[dlc] - errorCount) / en_entries[dlc] * 100 + errorCount = compare_tables(g.EID['descriptions']["en_us"], g.EID['descriptions'][languageCode], languageCode+"("+dlc+")") + percentage = (english_entries[dlc] - errorCount) / english_entries[dlc] * 100 languageProgress[languageCode][dlc] = [percentage, errorCount] - print(f"{Red}Errors found: {errorCount} / {en_entries[dlc]}{Color_Off}\n\n") + print(f"{Red}Errors found: {errorCount} / {english_entries[dlc]}{Color_Off}\n\n") # Calculate total english entries -total_en_entries = 0 -for entries in en_entries.values(): - total_en_entries += entries +total_english_entries = 0 +for entries in english_entries.values(): + total_english_entries += entries # Write git Workflow summary gitWorkflowSummary = "### Translation progress\n| Language | Completion (AB+) |Completion (REP) |Completion (REP+) |Completion (Total) |\n|---|---|---|---|---|\n" @@ -169,12 +169,12 @@ for lang in languageProgress.keys(): else: print( f"\t{BWhite}{lang}({dlc}){Color_Off}\t\t{Red}DLC translation missing!{Color_Off}") - gitCompletionMessage = f"0% ({en_entries[dlc]} left)" - totalMissing += en_entries[dlc] + gitCompletionMessage = f"0% ({english_entries[dlc]} left)" + totalMissing += english_entries[dlc] gitWorkflowSummary += f"| {gitCompletionMessage} " - totalPercent = round((total_en_entries - totalMissing) / total_en_entries * 100, 2) + totalPercent = round((total_english_entries - totalMissing) / total_english_entries * 100, 2) gitWorkflowSummary += f"|{totalPercent}% ({totalMissing}) " gitWorkflowSummary += "|\n" diff --git a/descriptions/ab+/bg.lua b/descriptions/ab+/bul.lua similarity index 99% rename from descriptions/ab+/bg.lua rename to descriptions/ab+/bul.lua index c27cef63..f9efdf07 100644 --- a/descriptions/ab+/bg.lua +++ b/descriptions/ab+/bul.lua @@ -8,16 +8,16 @@ -- ↑ = Up Arrow | ↓ = Down Arrow | ! = Warning | # = Starts a new line -- More can be found here: https://github.com/wofsauge/External-Item-Descriptions/wiki/Markup -local languageCode = "bg" +local languageCode = "bul" -- init Bulgarian table EID.descriptions[languageCode] = {} EID.descriptions[languageCode].custom = {} -- table for custom entity descriptions EID.descriptions[languageCode].languageName = "Bulgarian (WIP) (AB+)" -EID.descriptions[languageCode].alternativeLanguageCodes = {"bulgarian", "bul"} +EID.descriptions[languageCode].alternativeLanguageCodes = {"bulgarian", "bg"} -- Fonts to be used with this language pack -EID.descriptions[languageCode].fonts = EID.descriptions["en"].fonts +EID.descriptions[languageCode].fonts = EID.descriptions["en_us"].fonts ---------- Collectibles ---------- EID.descriptions[languageCode].collectibles={ diff --git a/descriptions/ab+/cs.lua b/descriptions/ab+/cs_cz.lua similarity index 99% rename from descriptions/ab+/cs.lua rename to descriptions/ab+/cs_cz.lua index 712abefa..4d264533 100644 --- a/descriptions/ab+/cs.lua +++ b/descriptions/ab+/cs_cz.lua @@ -8,16 +8,16 @@ -- ↑ = Up Arrow | ↓ = Down Arrow | ! = Warning | # = Starts a new line -- More can be found here: https://github.com/wofsauge/External-Item-Descriptions/wiki/Markup -local languageCode = "cs" +local languageCode = "cs_cz" -- init Czech table EID.descriptions[languageCode] = {} EID.descriptions[languageCode].custom = {} -- table for custom entity descriptions EID.descriptions[languageCode].languageName = "Czech" -EID.descriptions[languageCode].alternativeLanguageCodes = {"czech", "cs_cz"} +EID.descriptions[languageCode].alternativeLanguageCodes = {"czech", "cs"} -- Fonts to be used with this language pack -EID.descriptions[languageCode].fonts = EID.descriptions["en"].fonts +EID.descriptions[languageCode].fonts = EID.descriptions["en_us"].fonts ---------- Collectibles ---------- EID.descriptions[languageCode].collectibles={ diff --git a/descriptions/ab+/de.lua b/descriptions/ab+/de.lua index 2acad903..a14ebe75 100644 --- a/descriptions/ab+/de.lua +++ b/descriptions/ab+/de.lua @@ -17,7 +17,7 @@ EID.descriptions[languageCode].languageName = "German (WIP)" EID.descriptions[languageCode].alternativeLanguageCodes = {"german"} -- Fonts to be used with this language pack -EID.descriptions[languageCode].fonts = EID.descriptions["en"].fonts +EID.descriptions[languageCode].fonts = EID.descriptions["en_us"].fonts ---------- Collectibles ---------- diff --git a/descriptions/ab+/el.lua b/descriptions/ab+/el_gr.lua similarity index 99% rename from descriptions/ab+/el.lua rename to descriptions/ab+/el_gr.lua index 72280624..e5329c05 100644 --- a/descriptions/ab+/el.lua +++ b/descriptions/ab+/el_gr.lua @@ -13,13 +13,13 @@ -- ↑ = Up Arrow | ↓ = Down Arrow | ! = Warning | # = Starts a new line -- More can be found here: https://github.com/wofsauge/External-Item-Descriptions/wiki/Markup -local languageCode = "el" +local languageCode = "el_gr" -- init Greek table EID.descriptions[languageCode] = {} EID.descriptions[languageCode].custom = {} -- table for custom entity descriptions EID.descriptions[languageCode].languageName = "Greek (WIP) (AB+)" -EID.descriptions[languageCode].alternativeLanguageCodes = {"greek", "el_gr"} +EID.descriptions[languageCode].alternativeLanguageCodes = {"greek", "el"} -- Fonts to be used with this language pack EID.descriptions[languageCode].fonts = {{name="default"}, {name="inverted"}, {name="borderless"}} diff --git a/descriptions/ab+/en.lua b/descriptions/ab+/en_us.lua similarity index 99% rename from descriptions/ab+/en.lua rename to descriptions/ab+/en_us.lua index 1df6c1a0..20115dc9 100644 --- a/descriptions/ab+/en.lua +++ b/descriptions/ab+/en_us.lua @@ -8,13 +8,13 @@ -- ↑ = Up Arrow | ↓ = Down Arrow | # = Starts a new line -- More can be found here: https://github.com/wofsauge/External-Item-Descriptions/wiki/Markup -local languageCode = "en" +local languageCode = "en_us" -- init english tables EID.descriptions[languageCode] = {} EID.descriptions[languageCode].custom = {} -- table for custom entity descriptions EID.descriptions[languageCode].languageName = "English" -EID.descriptions[languageCode].alternativeLanguageCodes = {"english", "en_us"} +EID.descriptions[languageCode].alternativeLanguageCodes = {"english", "en"} -- Fonts to be used with this language pack EID.descriptions[languageCode].fonts = {{name="default"}, {name="inverted"}, {name="borderless"}} diff --git a/descriptions/ab+/it.lua b/descriptions/ab+/it.lua index 7e2aa93d..95725ef3 100644 --- a/descriptions/ab+/it.lua +++ b/descriptions/ab+/it.lua @@ -17,7 +17,7 @@ EID.descriptions[languageCode].languageName = "Italian" EID.descriptions[languageCode].alternativeLanguageCodes = {"italian"} -- Fonts to be used with this language pack -EID.descriptions[languageCode].fonts = EID.descriptions["en"].fonts +EID.descriptions[languageCode].fonts = EID.descriptions["en_us"].fonts ---------- Collectibles ---------- diff --git a/descriptions/ab+/ja.lua b/descriptions/ab+/ja_jp.lua similarity index 99% rename from descriptions/ab+/ja.lua rename to descriptions/ab+/ja_jp.lua index 71d57fad..9b50cd6c 100644 --- a/descriptions/ab+/ja.lua +++ b/descriptions/ab+/ja_jp.lua @@ -8,13 +8,13 @@ -- ↑ = Up Arrow | ↓ = Down Arrow | ! = Warning | # = Starts a new line -- More can be found here: https://github.com/wofsauge/External-Item-Descriptions/wiki/Markup -local languageCode = "ja" +local languageCode = "ja_jp" -- init Japanese table EID.descriptions[languageCode] = {} EID.descriptions[languageCode].custom = {} -- table for custom entity descriptions EID.descriptions[languageCode].languageName = "Japanese" -EID.descriptions[languageCode].alternativeLanguageCodes = {"japanese", "jp", "ja_jp"} +EID.descriptions[languageCode].alternativeLanguageCodes = {"japanese", "jp", "ja"} -- Fonts to be used with this language pack EID.descriptions[languageCode].fonts = {{name="default", lineHeight= 12}, {name="inverted", lineHeight = 12}, {name="borderless", lineHeight= 12}} diff --git a/descriptions/ab+/ko.lua b/descriptions/ab+/ko_kr.lua similarity index 99% rename from descriptions/ab+/ko.lua rename to descriptions/ab+/ko_kr.lua index a3c70bc5..a0224148 100644 --- a/descriptions/ab+/ko.lua +++ b/descriptions/ab+/ko_kr.lua @@ -12,13 +12,13 @@ -- 스탯 순서: 체력 - 빨간하트 - 블랙하트 - 소울하트 - 공격력 - 연사 - 사거리 - 이동속도 - 탄속 - 행운 - 효과 -local languageCode = "ko" +local languageCode = "ko_kr" -- init Korean table EID.descriptions[languageCode] = {} EID.descriptions[languageCode].custom = {} -- table for custom entity descriptions EID.descriptions[languageCode].languageName = "Korean" -EID.descriptions[languageCode].alternativeLanguageCodes = {"koreana", "kr", "ko_kr"} +EID.descriptions[languageCode].alternativeLanguageCodes = {"koreana", "kr", "ko"} -- Fonts to be used with this languagepack --[[ diff --git a/descriptions/ab+/nl.lua b/descriptions/ab+/nl_nl.lua similarity index 99% rename from descriptions/ab+/nl.lua rename to descriptions/ab+/nl_nl.lua index 6a82a45c..92053451 100644 --- a/descriptions/ab+/nl.lua +++ b/descriptions/ab+/nl_nl.lua @@ -8,13 +8,13 @@ -- ↑ = Up Arrow | ↓ = Down Arrow | ! = Warning | # = Starts a new line -- More can be found here: https://github.com/wofsauge/External-Item-Descriptions/wiki/Markup -local languageCode = "nl" +local languageCode = "nl_nl" -- init Dutch table EID.descriptions[languageCode] = {} EID.descriptions[languageCode].custom = {} -- table for custom entity descriptions EID.descriptions[languageCode].languageName = "Dutch (WIP) (AB+)" -EID.descriptions[languageCode].alternativeLanguageCodes = {"dutch", "nl_nl"} +EID.descriptions[languageCode].alternativeLanguageCodes = {"dutch", "nl"} -- Fonts to be used with this language pack EID.descriptions[languageCode].fonts = {{name="default"}, {name="inverted"}, {name="borderless"}} diff --git a/descriptions/ab+/pl.lua b/descriptions/ab+/pl.lua index 41982452..7dfa2785 100644 --- a/descriptions/ab+/pl.lua +++ b/descriptions/ab+/pl.lua @@ -17,7 +17,7 @@ EID.descriptions[languageCode].languageName = "Polish (WIP)" EID.descriptions[languageCode].alternativeLanguageCodes = {"polish"} -- Fonts to be used with this language pack -EID.descriptions[languageCode].fonts = EID.descriptions["en"].fonts +EID.descriptions[languageCode].fonts = EID.descriptions["en_us"].fonts ---------- Collectibles ---------- EID.descriptions[languageCode].collectibles={ diff --git a/descriptions/ab+/pt.lua b/descriptions/ab+/pt.lua index 013b03a5..aceaeb3b 100644 --- a/descriptions/ab+/pt.lua +++ b/descriptions/ab+/pt.lua @@ -19,7 +19,7 @@ EID.descriptions[languageCode].languageName = "Portuguese (WIP) (AB+)" EID.descriptions[languageCode].alternativeLanguageCodes = {"portuguese"} -- Fonts to be used with this language pack -EID.descriptions[languageCode].fonts = EID.descriptions["en"].fonts +EID.descriptions[languageCode].fonts = EID.descriptions["en_us"].fonts ---------- Collectibles ---------- EID.descriptions[languageCode].collectibles={ diff --git a/descriptions/ab+/pt_br.lua b/descriptions/ab+/pt_br.lua index 48875df2..d99a1d53 100644 --- a/descriptions/ab+/pt_br.lua +++ b/descriptions/ab+/pt_br.lua @@ -19,7 +19,7 @@ EID.descriptions[languageCode].languageName = "Brazilian Portuguese (WIP)" EID.descriptions[languageCode].alternativeLanguageCodes = {"pt-BR", "brazilian"} -- Fonts to be used with this language pack -EID.descriptions[languageCode].fonts = EID.descriptions["en"].fonts +EID.descriptions[languageCode].fonts = EID.descriptions["en_us"].fonts ---------- Collectibles ---------- EID.descriptions[languageCode].collectibles={ diff --git a/descriptions/ab+/ro.lua b/descriptions/ab+/ro_ro.lua similarity index 99% rename from descriptions/ab+/ro.lua rename to descriptions/ab+/ro_ro.lua index 0ca558b8..1d139143 100644 --- a/descriptions/ab+/ro.lua +++ b/descriptions/ab+/ro_ro.lua @@ -8,13 +8,13 @@ -- ↑ = Up Arrow | ↓ = Down Arrow | # = Starts a new line -- More can be found here: https://github.com/wofsauge/External-Item-Descriptions/wiki/Markup -local languageCode = "ro" +local languageCode = "ro_ro" -- init Romanian table EID.descriptions[languageCode] = {} EID.descriptions[languageCode].custom = {} -- table for custom entity descriptions EID.descriptions[languageCode].languageName = "Romanian" -EID.descriptions[languageCode].alternativeLanguageCodes = {"romanian", "ro_ro"} +EID.descriptions[languageCode].alternativeLanguageCodes = {"romanian", "ro"} -- Fonts to be used with this language pack EID.descriptions[languageCode].fonts = {{name="default"}, {name="inverted"}, {name="borderless"}} diff --git a/descriptions/ab+/ru.lua b/descriptions/ab+/ru.lua index 835e8b3d..f97626d1 100644 --- a/descriptions/ab+/ru.lua +++ b/descriptions/ab+/ru.lua @@ -17,7 +17,7 @@ EID.descriptions[languageCode].languageName = "Russian (WIP)" EID.descriptions[languageCode].alternativeLanguageCodes = {"russian"} -- Fonts to be used with this language pack -EID.descriptions[languageCode].fonts = EID.descriptions["en"].fonts +EID.descriptions[languageCode].fonts = EID.descriptions["en_us"].fonts ---------- Collectibles ---------- EID.descriptions[languageCode].collectibles={ diff --git a/descriptions/ab+/es.lua b/descriptions/ab+/spa.lua similarity index 99% rename from descriptions/ab+/es.lua rename to descriptions/ab+/spa.lua index c1f5c6e1..17f28f4d 100644 --- a/descriptions/ab+/es.lua +++ b/descriptions/ab+/spa.lua @@ -8,16 +8,16 @@ -- ↑ = Up Arrow | ↓ = Down Arrow | # = Starts a new line | ! = Warning -- More can be found here: https://github.com/wofsauge/External-Item-Descriptions/wiki/Markup -local languageCode = "es" +local languageCode = "spa" -- init Spanish table EID.descriptions[languageCode] = {} EID.descriptions[languageCode].custom = {} -- table for custom entity descriptions EID.descriptions[languageCode].languageName = "Spanish" -EID.descriptions[languageCode].alternativeLanguageCodes = {"spanish", "spa"} +EID.descriptions[languageCode].alternativeLanguageCodes = {"spanish", "es"} -- Fonts to be used with this language pack -EID.descriptions[languageCode].fonts = EID.descriptions["en"].fonts +EID.descriptions[languageCode].fonts = EID.descriptions["en_us"].fonts ---------- Collectibles ---------- diff --git a/descriptions/ab+/tr.lua b/descriptions/ab+/tr_tr.lua similarity index 99% rename from descriptions/ab+/tr.lua rename to descriptions/ab+/tr_tr.lua index 524ef7ea..f26f02e3 100644 --- a/descriptions/ab+/tr.lua +++ b/descriptions/ab+/tr_tr.lua @@ -8,16 +8,16 @@ -- ↑ = Up Arrow | ↓ = Down Arrow | ! = Warning | # = Starts a new line -- More can be found here: https://github.com/wofsauge/External-Item-Descriptions/wiki/Markup -local languageCode = "tr" +local languageCode = "tr_tr" -- init Turkish table EID.descriptions[languageCode] = {} EID.descriptions[languageCode].custom = {} -- table for custom entity descriptions EID.descriptions[languageCode].languageName = "Turkish (WIP)" -EID.descriptions[languageCode].alternativeLanguageCodes = {"turkish", "tr_tr"} +EID.descriptions[languageCode].alternativeLanguageCodes = {"turkish", "tr"} -- Fonts to be used with this language pack -EID.descriptions[languageCode].fonts = EID.descriptions["en"].fonts +EID.descriptions[languageCode].fonts = EID.descriptions["en_us"].fonts ---------- Collectibles ---------- EID.descriptions[languageCode].collectibles={ diff --git a/descriptions/ab+/uk.lua b/descriptions/ab+/uk_ua.lua similarity index 99% rename from descriptions/ab+/uk.lua rename to descriptions/ab+/uk_ua.lua index 87edfeaf..46bd269f 100644 --- a/descriptions/ab+/uk.lua +++ b/descriptions/ab+/uk_ua.lua @@ -8,13 +8,13 @@ -- ↑ = Up Arrow | ↓ = Down Arrow | ! = Warning | # = Starts a new line -- More can be found here: https://github.com/wofsauge/External-Item-Descriptions/wiki/Markup -local languageCode = "uk" +local languageCode = "uk_ua" -- init Ukrainian table EID.descriptions[languageCode] = {} EID.descriptions[languageCode].custom = {} -- table for custom entity descriptions EID.descriptions[languageCode].languageName = "Ukrainian (WIP)" -EID.descriptions[languageCode].alternativeLanguageCodes = {"ukrainian", "uk_ua"} +EID.descriptions[languageCode].alternativeLanguageCodes = {"ukrainian", "uk"} -- Fonts to be used with this language pack EID.descriptions[languageCode].fonts = {{name="default"}, {name="inverted"}, {name="borderless"}} diff --git a/descriptions/rep+/cs.lua b/descriptions/rep+/cs_cz.lua similarity index 99% rename from descriptions/rep+/cs.lua rename to descriptions/rep+/cs_cz.lua index 3b45f31b..dba31dc3 100644 --- a/descriptions/rep+/cs.lua +++ b/descriptions/rep+/cs_cz.lua @@ -8,7 +8,7 @@ -- ↑ = Up Arrow | ↓ = Down Arrow | # = Starts a new line -- More can be found here: https://github.com/wofsauge/External-Item-Descriptions/wiki/Markup -local languageCode = "cs" +local languageCode = "cs_cz" ---------- Collectibles ---------- diff --git a/descriptions/rep+/en.lua b/descriptions/rep+/en_us.lua similarity index 99% rename from descriptions/rep+/en.lua rename to descriptions/rep+/en_us.lua index 6cc5d5e7..d60ea2e6 100644 --- a/descriptions/rep+/en.lua +++ b/descriptions/rep+/en_us.lua @@ -8,7 +8,7 @@ -- ↑ = Up Arrow | ↓ = Down Arrow | # = Starts a new line -- More can be found here: https://github.com/wofsauge/External-Item-Descriptions/wiki/Markup -local languageCode = "en" +local languageCode = "en_us" ---------- Collectibles ---------- diff --git a/descriptions/rep+/ja.lua b/descriptions/rep+/ja_jp.lua similarity index 99% rename from descriptions/rep+/ja.lua rename to descriptions/rep+/ja_jp.lua index 72c8f4fa..e7330e1f 100644 --- a/descriptions/rep+/ja.lua +++ b/descriptions/rep+/ja_jp.lua @@ -8,7 +8,7 @@ -- ↑ = Up Arrow | ↓ = Down Arrow | # = Starts a new line -- More can be found here: https://github.com/wofsauge/External-Item-Descriptions/wiki/Markup -local languageCode = "ja" +local languageCode = "ja_jp" ---------- Collectibles ---------- diff --git a/descriptions/rep+/ko.lua b/descriptions/rep+/ko_kr.lua similarity index 99% rename from descriptions/rep+/ko.lua rename to descriptions/rep+/ko_kr.lua index d8f11e71..8e50869e 100644 --- a/descriptions/rep+/ko.lua +++ b/descriptions/rep+/ko_kr.lua @@ -8,7 +8,7 @@ -- ↑ = Up Arrow | ↓ = Down Arrow | # = Starts a new line -- More can be found here: https://github.com/wofsauge/External-Item-Descriptions/wiki/Markup -local languageCode = "ko" +local languageCode = "ko_kr" -- 1.7.9.11 Conditional todos -- T.??? + Bombs are Key diff --git a/descriptions/rep+/ro.lua b/descriptions/rep+/ro_ro.lua similarity index 99% rename from descriptions/rep+/ro.lua rename to descriptions/rep+/ro_ro.lua index 5c400b77..2292e5e9 100644 --- a/descriptions/rep+/ro.lua +++ b/descriptions/rep+/ro_ro.lua @@ -8,7 +8,7 @@ -- ↑ = Up Arrow | ↓ = Down Arrow | # = Starts a new line -- More can be found here: https://github.com/wofsauge/External-Item-Descriptions/wiki/Markup -local languageCode = "ro" +local languageCode = "ro_ro" ---------- Collectibles ---------- diff --git a/descriptions/rep+/es.lua b/descriptions/rep+/spa.lua similarity index 99% rename from descriptions/rep+/es.lua rename to descriptions/rep+/spa.lua index 541577d3..6e023015 100644 --- a/descriptions/rep+/es.lua +++ b/descriptions/rep+/spa.lua @@ -8,7 +8,7 @@ -- ↑ = Up Arrow | ↓ = Down Arrow | # = Starts a new line | ! = Warning -- More can be found here: https://github.com/wofsauge/External-Item-Descriptions/wiki/Markup -local languageCode = "es" +local languageCode = "spa" ---------- Collectibles ---------- diff --git a/descriptions/rep+/uk.lua b/descriptions/rep+/uk_ua.lua similarity index 99% rename from descriptions/rep+/uk.lua rename to descriptions/rep+/uk_ua.lua index 9083e924..a8331875 100644 --- a/descriptions/rep+/uk.lua +++ b/descriptions/rep+/uk_ua.lua @@ -4,7 +4,7 @@ -- Last Sync with English version: 29.11.2024 -local languageCode = "uk" +local languageCode = "uk_ua" ---------- Collectibles ---------- diff --git a/descriptions/rep/cs.lua b/descriptions/rep/cs_cz.lua similarity index 99% rename from descriptions/rep/cs.lua rename to descriptions/rep/cs_cz.lua index b1c9cf7b..74032653 100644 --- a/descriptions/rep/cs.lua +++ b/descriptions/rep/cs_cz.lua @@ -9,7 +9,7 @@ -- Special character markup: -- ↑ = Up Arrow | ↓ = Down Arrow | ! = Warning -local languageCode = "cs" +local languageCode = "cs_cz" local repCollectibles={ [2] = {"2", "Vnitřní Oko", "Trojitý výstřel#↓ {{Tears}} -49% Méně Slz"}, diff --git a/descriptions/rep/en.lua b/descriptions/rep/en_us.lua similarity index 99% rename from descriptions/rep/en.lua rename to descriptions/rep/en_us.lua index df8608fc..ec1cda9d 100644 --- a/descriptions/rep/en.lua +++ b/descriptions/rep/en_us.lua @@ -8,7 +8,7 @@ -- ↑ = Up Arrow | ↓ = Down Arrow | # = Starts a new line -- More can be found here: https://github.com/wofsauge/External-Item-Descriptions/wiki/Markup -local languageCode = "en" +local languageCode = "en_us" ---------- Collectibles ---------- diff --git a/descriptions/rep/ja.lua b/descriptions/rep/ja_jp.lua similarity index 99% rename from descriptions/rep/ja.lua rename to descriptions/rep/ja_jp.lua index c4129f64..f4ed1668 100644 --- a/descriptions/rep/ja.lua +++ b/descriptions/rep/ja_jp.lua @@ -8,7 +8,7 @@ -- ↑ = Up Arrow | ↓ = Down Arrow | # = Starts a new line -- More can be found here: https://github.com/wofsauge/External-Item-Descriptions/wiki/Markup -local languageCode = "ja" +local languageCode = "ja_jp" ---------- Collectibles ---------- diff --git a/descriptions/rep/ko.lua b/descriptions/rep/ko_kr.lua similarity index 99% rename from descriptions/rep/ko.lua rename to descriptions/rep/ko_kr.lua index c155fb6c..6539d879 100644 --- a/descriptions/rep/ko.lua +++ b/descriptions/rep/ko_kr.lua @@ -1,4 +1,4 @@ -local languageCode = "ko" +local languageCode = "ko_kr" -- Last Sync with English or update: 2024-11-18 diff --git a/descriptions/rep/ro.lua b/descriptions/rep/ro_ro.lua similarity index 99% rename from descriptions/rep/ro.lua rename to descriptions/rep/ro_ro.lua index 207083fa..40a62ad9 100644 --- a/descriptions/rep/ro.lua +++ b/descriptions/rep/ro_ro.lua @@ -8,7 +8,7 @@ -- ↑ = Up Arrow | ↓ = Down Arrow | # = Starts a new line -- More can be found here: https://github.com/wofsauge/External-Item-Descriptions/wiki/Markup -local languageCode = "ro" +local languageCode = "ro_ro" ---------- Collectibles ---------- diff --git a/descriptions/rep/es.lua b/descriptions/rep/spa.lua similarity index 99% rename from descriptions/rep/es.lua rename to descriptions/rep/spa.lua index 383a3531..cb5efbec 100644 --- a/descriptions/rep/es.lua +++ b/descriptions/rep/spa.lua @@ -8,7 +8,7 @@ -- ↑ = Up Arrow | ↓ = Down Arrow | # = Starts a new line | ! = Warning -- More can be found here: https://github.com/wofsauge/External-Item-Descriptions/wiki/Markup -local languageCode = "es" +local languageCode = "spa" ---------- Collectibles ---------- diff --git a/descriptions/rep/tr.lua b/descriptions/rep/tr_tr.lua similarity index 99% rename from descriptions/rep/tr.lua rename to descriptions/rep/tr_tr.lua index 8abf313d..8423197e 100644 --- a/descriptions/rep/tr.lua +++ b/descriptions/rep/tr_tr.lua @@ -11,7 +11,7 @@ -- Special character markup: -- ↑ = Up Arrow | ↓ = Down Arrow | ! = Warning -local languageCode = "tr" +local languageCode = "tr_tr" local repCollectibles={ [5] = {"5", "Yansımam", "Bumerang efekti verır#↑ +1.5 Menzil#↑ +60% ekstra Menzil#↑ +0.6 Gözyaşı hızı#↑ +1 Gözyaşı yüksekliği"}, -- My Reflection diff --git a/descriptions/rep/uk.lua b/descriptions/rep/uk_ua.lua similarity index 99% rename from descriptions/rep/uk.lua rename to descriptions/rep/uk_ua.lua index e65de0bd..04624894 100644 --- a/descriptions/rep/uk.lua +++ b/descriptions/rep/uk_ua.lua @@ -9,7 +9,7 @@ -- Special character markup: -- ↑ = Up Arrow | ↓ = Down Arrow | !!! = Warning -local languageCode = "uk" +local languageCode = "uk_ua" local repCollectibles={ [2] = {"2", "Внутрiшнє Око", "Потрiйний пострiл#↓ {{Tears}} -49% Скорострільність знижено"}, diff --git a/eid_config.lua b/eid_config.lua index 02cca6a6..7d63842d 100644 --- a/eid_config.lua +++ b/eid_config.lua @@ -2,24 +2,24 @@ EID.UserConfig = { -------GENERAL--------- -- Change the language of the mod -- Currently Supported: automatic = "auto" (Default) Chooses the mod language based on your game's language settings(Rep), or defaults to English for ab+ users. - -- Bulgarian = "bg" SPECIAL THANKS TO Gothika_47 + -- Bulgarian = "bul" SPECIAL THANKS TO Gothika_47 -- Chinese (Simplified) = "zh_cn" SPECIAL THANKS TO Xheepey87, frto027 - -- Czech = "cs" SPECIAL THANKS TO domcizzz - -- Dutch = "nl" SPECIAL THANKS TO SomethingMax - -- English = "en" SPECIAL THANKS TO everyone! + -- Czech = "cs_cz" SPECIAL THANKS TO domcizzz + -- Dutch = "nl_nl" SPECIAL THANKS TO SomethingMax + -- English = "en_us" SPECIAL THANKS TO everyone! -- French = "fr" SPECIAL THANKS TO biobak -- German = "de" SPECIAL THANKS TO Jake - -- Greek = "el" SPECIAL THANKS TO vanillarat + -- Greek = "el_gr" SPECIAL THANKS TO vanillarat -- Italian = "it" SPECIAL THANKS TO Denkishi, 2G - -- Japanese = "ja" SPECIAL THANKS TO prefab - -- Korean = "ko" SPECIAL THANKS TO Blackcreamtea, 리셰(kohashiwakaba) + -- Japanese = "ja_jp" SPECIAL THANKS TO prefab + -- Korean = "ko_kr" SPECIAL THANKS TO Blackcreamtea, 리셰(kohashiwakaba) -- Polish = "pl" SPECIAL THANKS TO Rickyy -- Portuguese = "pt" SPECIAL THANKS TO Marcelino Cruz -- Brazilian Portuguese = "pt_br" SPECIAL THANKS TO Marcelino Cruz -- Russian = "ru" SPECIAL THANKS TO hell2pay, fly_6 - -- Spanish = "es" SPECIAL THANKS TO Lidia Arroyo Purroy - -- Turkish = "tr" SPECIAL THANKS TO Mert Dutal - -- Ukrainian = "uk" SPECIAL THANKS TO x3xto + -- Spanish = "spa" SPECIAL THANKS TO Lidia Arroyo Purroy + -- Turkish = "tr_tr" SPECIAL THANKS TO Mert Dutal + -- Ukrainian = "uk_ua" SPECIAL THANKS TO x3xto -- -- If you want to make a translation, please contact me :) (wofsauge) -- diff --git a/features/eid_api.lua b/features/eid_api.lua index a5124ad5..242b634e 100644 --- a/features/eid_api.lua +++ b/features/eid_api.lua @@ -122,10 +122,10 @@ local dynamicSpriteCache = {} -- used to store sprite objects of collectible ico ---@param id CollectibleType ---@param description string ---@param itemName string? ----@param language EID_LanguageCode? @Default: "en" +---@param language EID_LanguageCode? @Default: "en_us" function EID:addCollectible(id, description, itemName, language) itemName = itemName or nil - language = language or "en" + language = language or EID.DefaultLanguageCode if id == -1 then EID:WriteErrorMsg("Trying to add collectible description to id = -1, which is not allowed! (Name: "..tostring(itemName).."; Description: "..tostring(description)..")") return @@ -141,10 +141,10 @@ end ---@param id TrinketType ---@param description string ---@param itemName? string ----@param language? EID_LanguageCode @Default: "en" +---@param language? EID_LanguageCode @Default: "en_us" function EID:addTrinket(id, description, itemName, language) itemName = itemName or nil - language = language or "en" + language = language or EID.DefaultLanguageCode if id == -1 then EID:WriteErrorMsg("Trying to add trinket description to id = -1, which is not allowed! (Name: "..tostring(itemName).."; Description: "..tostring(description)..")") return @@ -157,10 +157,10 @@ end ---@param characterId PlayerType ---@param description string ---@param playerName? string @Default: "Modded Character" ----@param language? EID_LanguageCode @Default: "en" +---@param language? EID_LanguageCode @Default: "en_us" function EID:addCharacterInfo(characterId, description, playerName, language) playerName = playerName or "Modded Character" - language = language or "en" + language = language or EID.DefaultLanguageCode if characterId == -1 then EID:WriteErrorMsg("Trying to add character description to id = -1, which is not allowed! (Name: "..tostring(playerName).."; Description: "..tostring(description)..")") return @@ -173,14 +173,14 @@ end ---@param appendText? string | string[] @Text to be appended onto the description. Can be one string, or a table of two strings; one for doubling and one for tripling ---@param numbersToMultiply? number | number[] @The number inside the text that should be multiplied. can be one number, or a table of numbers ---@param maxMultiplier? number @Is what tripling (Golden+Mom's Box) should multiply the numbers by, normally 3. If it's less than 2, it also applies to doubling ----@param language? EID_LanguageCode @Default: "en" +---@param language? EID_LanguageCode @Default: "en_us" -- Example: My modded trinket gives +0.5 range and when tripled, adds homing instead of tripling the range boost: --- ```lua --- EID:addGoldenTrinketMetadata(Isaac.GetTrinketIdByName("Cool Trinket"), {"", "Homing tears"}, 0.5, 2) --- ``` function EID:addGoldenTrinketMetadata(id, appendText, numbersToMultiply, maxMultiplier, language) maxMultiplier = maxMultiplier or 3 - language = language or "en" + language = language or EID.DefaultLanguageCode if appendText == "" then appendText = nil elseif type(appendText) == "string" then appendText = {appendText} end @@ -199,13 +199,13 @@ end ---@param appendText? string | string[] @Text to be appended onto the description. Can be one string, or a table of two strings; one for doubling and one for tripling ---@param numbersToChange? number | number[] @The number inside the text that gets added towards. can be one number, or a table of numbers ---@param additiveValues? number @Table of values that should be added to the number, if its doubled, tripled, or quadrupled ----@param language? EID_LanguageCode @Default: "en" +---@param language? EID_LanguageCode @Default: "en_us" -- Example: My modded trinket gives +5 range and when tripled, adds homing instead of tripling the range boost: --- ```lua --- EID:addGoldenTrinketMetadataAdditive(Isaac.GetTrinketIdByName("Cool Trinket"), {"", "Homing tears"}, 5, {1,2,3}) --- ``` function EID:addGoldenTrinketMetadataAdditive(id, appendText, numbersToChange, additiveValues, language) - language = language or "en" + language = language or EID.DefaultLanguageCode if appendText == "" then appendText = nil elseif type(appendText) == "string" then appendText = {appendText} end @@ -235,10 +235,10 @@ end ---@param id Card ---@param description string ---@param itemName? string ----@param language? EID_LanguageCode @Default: "en" +---@param language? EID_LanguageCode @Default: "en_us" function EID:addCard(id, description, itemName, language) itemName = itemName or nil - language = language or "en" + language = language or EID.DefaultLanguageCode if id == -1 then EID:WriteErrorMsg("Trying to add card description to id = -1, which is not allowed! (Name: "..tostring(itemName).."; Description: "..tostring(description)..")") return @@ -257,10 +257,10 @@ end ---@param id PillEffect ---@param description string ---@param itemName? string ----@param language? EID_LanguageCode @Default: "en" +---@param language? EID_LanguageCode @Default: "en_us" function EID:addPill(id, description, itemName, language) itemName = itemName or nil - language = language or "en" + language = language or EID.DefaultLanguageCode if id == -1 then EID:WriteErrorMsg("Trying to add pill description to id = -1, which is not allowed! (Name: "..tostring(itemName).."; Description: "..tostring(description)..")") return @@ -278,11 +278,11 @@ end ---@param id PillEffect ---@param description string ---@param itemName? string ----@param language? EID_LanguageCode @Default: "en" +---@param language? EID_LanguageCode @Default: "en_us" function EID:addHorsePill(id, description, itemName, language) if not EID.isRepentance then return end itemName = itemName or nil - language = language or "en" + language = language or EID.DefaultLanguageCode if id == -1 then EID:WriteErrorMsg("Trying to add horsepill description to id = -1, which is not allowed! (Name: "..tostring(itemName).."; Description: "..tostring(description)..")") return @@ -306,10 +306,10 @@ end ---@param characterId PlayerType ---@param description string ---@param playerName? string ----@param language? EID_LanguageCode @Default: "en" +---@param language? EID_LanguageCode @Default: "en_us" function EID:addBirthright(characterId, description, playerName, language) playerName = playerName or nil - language = language or "en" + language = language or EID.DefaultLanguageCode if characterId == -1 then EID:WriteErrorMsg("Trying to add Birthright description to id = -1, which is not allowed! (Name: "..tostring(characterId).."; Description: "..tostring(description)..")") return @@ -321,9 +321,9 @@ end ---Creates a new transformation with a given unique name and a display name ---@param uniqueName string ---@param displayName string ----@param language? EID_LanguageCode @Default: "en" +---@param language? EID_LanguageCode @Default: "en_us" function EID:createTransformation(uniqueName, displayName, language) - language = language or "en" + language = language or EID.DefaultLanguageCode if EID.CustomTransformations[uniqueName] == nil then EID.CustomTransformations[uniqueName] = {} end @@ -436,10 +436,10 @@ end ---@param subtype? integer @If `nil` or `-1`, it will affect all subtypes of that entity ---@param entityName string ---@param description string ----@param language? EID_LanguageCode @Default: "en" +---@param language? EID_LanguageCode @Default: "en_us" function EID:addEntity(id, variant, subtype, entityName, description, language) subtype = subtype or -1 - language = language or "en" + language = language or EID.DefaultLanguageCode if id == EntityType.ENTITY_EFFECT then EID.effectList[variant] = true end @@ -470,13 +470,13 @@ end ---This spell should be added with the "Custom Poop API" library to actually appear in-game. ---Example: ---```lua ----EID:addCustomPoopSpell("MYPOOP", "I Made This Poop", "{{PoopSpell1}}", "Can be throwed to deal damage", "en") +---EID:addCustomPoopSpell("MYPOOP", "I Made This Poop", "{{PoopSpell1}}", "Can be throwed to deal damage", "en_us") ---``` ---@param token string @The name of the spell in the Custom Poop API code ---@param name string @The name of the spell as it should appear in the description ---@param icon string @Markup icon of the poop ---@param description string ----@param language? EID_LanguageCode @Default: "en" +---@param language? EID_LanguageCode @Default: "en_us" function EID:addCustomPoopSpell(token, name, icon, description, language) EID.descriptions[language]["poopSpells"][token] = {icon, name, description, EID._currentMod} end @@ -764,12 +764,12 @@ end function EID:getDescriptionEntry(objTable, objIdentifier, noFallback) if not objIdentifier then if noFallback then return EID.descriptions[EID:getLanguage()][objTable] - else return EID.descriptions[EID:getLanguage()][objTable] or EID.descriptions["en"][objTable] end + else return EID.descriptions[EID:getLanguage()][objTable] or EID.descriptions[EID.DefaultLanguageCode][objTable] end else local translatedTable = EID.descriptions[EID:getLanguage()][objTable] local description if noFallback then description = translatedTable and translatedTable[objIdentifier] - else description = (translatedTable and translatedTable[objIdentifier]) or (EID.descriptions["en"][objTable] and EID.descriptions["en"][objTable][objIdentifier]) end + else description = (translatedTable and translatedTable[objIdentifier]) or (EID.descriptions[EID.DefaultLanguageCode][objTable] and EID.descriptions[EID.DefaultLanguageCode][objTable][objIdentifier]) end --Try looking for a -1 that would encompass all subtypes of the variant -- Safety check for if the identifier contains "."(dot) 1-2 times and only contains numbers local strNoDots, numDots = string.gsub(objIdentifier, "%.","") @@ -796,9 +796,9 @@ end ---@return string function EID:getDescriptionEntryEnglish(objTable, objID) if not objID then - return EID.descriptions["en"][objTable] + return EID.descriptions[EID.DefaultLanguageCode][objTable] else - return EID.descriptions["en"][objTable] and EID.descriptions["en"][objTable][objID] + return EID.descriptions[EID.DefaultLanguageCode][objTable] and EID.descriptions[EID.DefaultLanguageCode][objTable][objID] end end @@ -892,7 +892,7 @@ function EID:getTransformationName(id) -- get translated custom name local customTransform = EID.CustomTransformations[id] if customTransform ~= nil then - return customTransform[EID:getLanguage()] or customTransform["en"] or id + return customTransform[EID:getLanguage()] or customTransform[EID.DefaultLanguageCode] or id end return id end @@ -909,7 +909,7 @@ function EID:getObjectName(Type, Variant, SubType) local tableEntry = EID:getDescriptionData(Type, Variant, SubType) local name = nil if tableEntry ~= nil then - if tableEntry[2] ~= nil and tableEntry[2] ~= "" and tableEntry[2] ~= EID.descriptions["en"][tableName][SubType] then + if tableEntry[2] ~= nil and tableEntry[2] ~= "" and tableEntry[2] ~= EID.descriptions[EID.DefaultLanguageCode][tableName][SubType] then name = tableEntry[2] end end @@ -917,18 +917,18 @@ function EID:getObjectName(Type, Variant, SubType) if tableName == "collectibles" then if EID.itemConfig:GetCollectible(SubType) == nil then return fallbackName end local vanillaName = EID.itemConfig:GetCollectible(SubType).Name - local englishName = EID.descriptions["en"][tableName][SubType] and EID.descriptions["en"][tableName][SubType][2] + local englishName = EID.descriptions[EID.DefaultLanguageCode][tableName][SubType] and EID.descriptions[EID.DefaultLanguageCode][tableName][SubType][2] return name or (not string.find(vanillaName, "^#") and vanillaName) or englishName or vanillaName elseif tableName == "trinkets" then local adjustedSubtype = EID:getAdjustedSubtype(Type, Variant, SubType) if EID.itemConfig:GetTrinket(adjustedSubtype) == nil then return fallbackName end local vanillaName = EID.itemConfig:GetTrinket(adjustedSubtype).Name - local englishName = EID.descriptions["en"][tableName][adjustedSubtype] and EID.descriptions["en"][tableName][adjustedSubtype][2] + local englishName = EID.descriptions[EID.DefaultLanguageCode][tableName][adjustedSubtype] and EID.descriptions[EID.DefaultLanguageCode][tableName][adjustedSubtype][2] return name or (not string.find(vanillaName, "^#") and vanillaName) or englishName or vanillaName elseif tableName == "cards" then if EID.itemConfig:GetCard(SubType) == nil then return fallbackName end local vanillaName = EID.itemConfig:GetCard(SubType).Name - local englishName = EID.descriptions["en"][tableName][SubType] and EID.descriptions["en"][tableName][SubType][2] + local englishName = EID.descriptions[EID.DefaultLanguageCode][tableName][SubType] and EID.descriptions[EID.DefaultLanguageCode][tableName][SubType][2] return name or (not string.find(vanillaName, "^#") and vanillaName) or englishName or vanillaName elseif tableName == "pills" or tableName == "horsepills" then local adjustedSubtype = EID:getAdjustedSubtype(Type, Variant, SubType) @@ -981,7 +981,7 @@ function EID:getPillName(pillID, isHorsepill) else vanillaName = EID.itemConfig:GetPillEffect(pillID - 1).Name end - name = name and name[2] or (not string.find(vanillaName, "^#") and vanillaName) or EID.descriptions["en"][tableName][pillID][2] or vanillaName + name = name and name[2] or (not string.find(vanillaName, "^#") and vanillaName) or EID.descriptions[EID.DefaultLanguageCode][tableName][pillID][2] or vanillaName name = string.gsub(name,"I'm Excited!!!","I'm Excited!!") -- prevent markup trigger return name end @@ -1239,7 +1239,7 @@ function EID:getTransformationIcon(str) return EID.InlineIcons["ERROR"] end if tonumber(str) ~= nil then - str = EID.descriptions["en"].transformations[tonumber(str + 1)] + str = EID.descriptions[EID.DefaultLanguageCode].transformations[tonumber(str + 1)] end local transformSprite = EID:getIcon(str:gsub(" ", "")) if transformSprite[1] == "ERROR" then diff --git a/features/eid_bagofcrafting.lua b/features/eid_bagofcrafting.lua index a13c8dfa..7c95b726 100644 --- a/features/eid_bagofcrafting.lua +++ b/features/eid_bagofcrafting.lua @@ -1150,7 +1150,7 @@ function EID:handleBagOfCraftingRendering(ignoreRefreshRate) -- Nothing in our recipe list passed the test; try checking English names as a backup if #IDsToCheck == 0 then local curLang = EID:getLanguage() - EID.Config["Language"] = "en" + EID.Config["Language"] = EID.DefaultLanguageCode for _,id in ipairs(sortedIDs) do local searchValid = EID:BoCSCheckItemName(EID:getObjectName(5, 100, id)) if (searchValid) then table.insert(IDsToCheck, id) end diff --git a/features/eid_bagofcrafting_search.lua b/features/eid_bagofcrafting_search.lua index 7f5cac3e..2622f999 100644 --- a/features/eid_bagofcrafting_search.lua +++ b/features/eid_bagofcrafting_search.lua @@ -57,7 +57,7 @@ end EID:AddCallback("EIDCallbacks.SEARCH_NAME_CONVERSION", function(_, searchString) -- TODO : make english search inside ko_kr language setting (priotity low though) - if EID:getLanguage() == "ko" then + if EID:getLanguage() == "ko_kr" then return EID.engKeystrokeToKor(searchString) end end) diff --git a/features/eid_conditionals_funcs.lua b/features/eid_conditionals_funcs.lua index 7d1f2461..6f90adb9 100644 --- a/features/eid_conditionals_funcs.lua +++ b/features/eid_conditionals_funcs.lua @@ -20,7 +20,7 @@ end -- Optional parameters: replaceText, language, extraTable -- Example usage: EID:addCondition(myDevilishItemID, EID.IsGreedMode, "{{GreedMode}} Reduces shop prices by 1 for each optional Nightmare wave completed") function EID:addCondition(ID, ownedID, text, replaceText, language, extraTable) - language = language or "en" + language = language or EID.DefaultLanguageCode if replaceText then text = {text, replaceText} end local modifierText = newModdedCondition(text, language) if type(ownedID) ~= "function" then @@ -37,7 +37,7 @@ end -- Optional parameters: text2, language, extraTable -- Example usage: EID:addSynergyCondition(myHappyLittleItemID, {CollectibleType.COLLECTIBLE_BRIMSTONE, CollectibleType.COLLECTIBLE_SULFUR}, "Turns your laser into a smiley face that charms enemies") function EID:addSynergyCondition(ID1, ID2, text1, text2, language, extraTable) - language = language or "en" + language = language or EID.DefaultLanguageCode local modifierText1 = newModdedCondition(text1, language) local modifierText2 = newModdedCondition(text2, language) EID:AddSynergyConditional(ID1, ID2, modifierText1, modifierText2, extraTable) @@ -49,7 +49,7 @@ end -- Optional parameters: replaceText, language, extraTable, includeTainted -- Example usage: EID:addPlayerCondition(myAngstyItemID, PlayerType.PLAYER_EVE, "Gives Eve extra mascara (2x Damage multiplier)") function EID:addPlayerCondition(ID, playerID, text, replaceText, language, extraTable, includeTainted) - language = language or "en" + language = language or EID.DefaultLanguageCode if replaceText then text = {text, replaceText} end local modifierText = newModdedCondition(text, language) EID:AddPlayerConditional(ID, playerID, modifierText, extraTable, includeTainted) @@ -61,7 +61,7 @@ end -- or, if you provide newNumber, it changes numberToDouble to that (technically, it's just a find/replace pair, any strings work) -- Example usage: EID:addToGeneralCondition(myVeryHealthyItemID, "bingeEaterBuffs", "↑ {{Speed}} +0.15 Speed#↓ {{Tears}} -0.5 Tears#↓ {{Damage}} -0.5 Damage") function EID:addToGeneralCondition(ID, locTable, text, numberToDouble, newNumber, language) - language = language or "en" + language = language or EID.DefaultLanguageCode if numberToDouble then newNumber = newNumber or numberToDouble * 2 text = { numberToDouble, newNumber, text } @@ -103,7 +103,7 @@ end -- Shortcut function for adding BFFS conditions; this is slightly more complex since it supports trinkets -- Example usage: EID:addBFFSCondition(myBasicFamiliarID, nil, 3.5) function EID:addBFFSCondition(ID, text, numberToDouble, newNumber, language) - language = language or "en" + language = language or EID.DefaultLanguageCode if numberToDouble then newNumber = newNumber or numberToDouble * 2 text = { numberToDouble, newNumber, text } @@ -119,7 +119,7 @@ end -- Shortcut function for adding Hive Mind conditions; by default, it will show with BFFS too, unless you pass in allowBFFS as false function EID:addHiveMindCondition(ID, text, numberToDouble, newNumber, language, allowBFFS) - language = language or "en" + language = language or EID.DefaultLanguageCode if allowBFFS == nil then allowBFFS = true end EID.HiveMindFamiliars[ID] = true if not allowBFFS then EID.BFFSIgnore[ID] = true end diff --git a/features/eid_debugging.lua b/features/eid_debugging.lua index ed6d88da..9e0abdf1 100644 --- a/features/eid_debugging.lua +++ b/features/eid_debugging.lua @@ -4,7 +4,7 @@ local showDebugChars = false -- check integrity of language files -local languageFilesToCheck = {"fr"} -- EID.Languages -- single file check example {"ko"} +local languageFilesToCheck = {"fr"} -- EID.Languages -- single file check example {"ko_kr"} -- count English entries for stats local count = 0 @@ -16,7 +16,7 @@ function EID:countEntries(t) end end end -EID:countEntries(EID.descriptions["en"]) +EID:countEntries(EID.descriptions[EID.DefaultLanguageCode]) local enUSEntries = count EID:WriteDebugMsg("English entries: "..enUSEntries) @@ -84,7 +84,7 @@ for _, lang in ipairs(languageFilesToCheck) do end local progress = { 0, 0 } - EID:compareTables(EID.descriptions["en"], EID.descriptions[lang], lang, progress) + EID:compareTables(EID.descriptions[EID.DefaultLanguageCode], EID.descriptions[lang], lang, progress) local errors = (enUSEntries - progress[1])-progress[2] EID:WriteDebugMsg("Errors found: "..errors .." / "..enUSEntries) diff --git a/features/eid_grid_descriptions.lua b/features/eid_grid_descriptions.lua index 05841b3d..4d56c881 100644 --- a/features/eid_grid_descriptions.lua +++ b/features/eid_grid_descriptions.lua @@ -22,10 +22,10 @@ EID.GridEntityWhitelist = setmetatable({}, { ---@param variant integer ---@param name string ---@param description string ----@param language? EID_LanguageCode @Default: "en" +---@param language? EID_LanguageCode @Default: "en_us" function EID:addGridEntity(type, variant, name, description, language) variant = variant or 0 - language = language or "en" + language = language or EID.DefaultLanguageCode EID:CreateDescriptionTableIfMissing("custom", language) EID.descriptions[language].custom["-999." .. type .. "." .. variant] = { @@ -96,10 +96,10 @@ local function SacrificeRoomCondition(_) end local function SacrificeRoomCallback(descObj) - descObj.ObjSubType = math.min(#EID.descriptions["en"].sacrifice, descObj.Entity.VarData + 1) + descObj.ObjSubType = math.min(#EID.descriptions[EID.DefaultLanguageCode].sacrifice, descObj.Entity.VarData + 1) -- Get sacrifice name by subtype descObj.Name = EID:getDescriptionEntry("sacrificeHeader") .. - " (" .. descObj.ObjSubType .. "/" .. #EID.descriptions["en"].sacrifice .. ")" + " (" .. descObj.ObjSubType .. "/" .. #EID.descriptions[EID.DefaultLanguageCode].sacrifice .. ")" descObj.Description = EID:getDescriptionEntry("sacrifice", descObj.ObjSubType)[3] local curCounter = descObj.ObjSubType or 1 diff --git a/features/eid_holdmapdesc.lua b/features/eid_holdmapdesc.lua index 1ad0e4b3..46f29fd8 100644 --- a/features/eid_holdmapdesc.lua +++ b/features/eid_holdmapdesc.lua @@ -625,7 +625,7 @@ function EID:ItemReminderHandlePoopSpells(player) local ignoreExisting = false if customPoop == nil then --If the poop still doesn't exist, use the unkown one instead - customPoop = EID:getDescriptionEntry("poopSpells")["Unknown"] or EID.descriptions["en"]["poopSpells"]["Unknown"] + customPoop = EID:getDescriptionEntry("poopSpells")["Unknown"] or EID.descriptions[EID.DefaultLanguageCode]["poopSpells"]["Unknown"] ignoreExisting = true end diff --git a/features/eid_language_manager.lua b/features/eid_language_manager.lua index 151932dd..1f0180ab 100644 --- a/features/eid_language_manager.lua +++ b/features/eid_language_manager.lua @@ -1,24 +1,27 @@ +-- Variable that contains the default language code of the mod (English) +EID.DefaultLanguageCode = "en_us" + -- List of all valid languages EID.Languages = { - "en", -- English + "en_us", -- English "fr", -- French "pt", -- Portuguese "pt_br", -- Brazilian Portuguese "ru", -- Russian - "es", -- Spanish + "spa", -- Spanish "it", -- Italian - "bg", -- Bulgarian + "bul", -- Bulgarian "pl", -- Polish "de", -- German - "tr", -- Turkish - "ko", -- Korean + "tr_tr", -- Turkish + "ko_kr", -- Korean "zh_cn", -- Simplified Chinese - "ja", -- Japanese - "cs", -- Czech - "nl", -- Dutch - "uk", -- Ukrainian - "el", -- Greek - "ro", -- Romanian + "ja_jp", -- Japanese + "cs_cz", -- Czech + "nl_nl", -- Dutch + "uk_ua", -- Ukrainian + "el_gr", -- Greek + "ro_ro", -- Romanian "vi" -- Vietnamese } @@ -29,36 +32,36 @@ EID.BreakUtf8CharsLanguage = { --#region Luadoc definitions ---@alias EID_LanguageCode ----| "bg" @Bulgarian ----| "cs" @Czech +---| "bul" @Bulgarian +---| "cs_cz" @Czech ---| "de" @German ----| "el" @Greek ----| "en" @English ----| "es" @Spanish +---| "el_gr" @Greek +---| "en_us" @English +---| "spa" @Spanish ---| "fr" @French ---| "it" @Italian ----| "ja" @Japanese ----| "ko" @Korean ----| "nl" @Dutch +---| "ja_jp" @Japanese +---| "ko_kr" @Korean +---| "nl_nl" @Dutch ---| "pl" @Polish ---| "pt_br" @Brasilian Portuguese ---| "pt" @Portuguese ----| "ro" @Romanian +---| "ro_ro" @Romanian ---| "ru" @Russian ----| "tr" @Turkish ----| "uk" @Ukrainian +---| "tr_tr" @Turkish +---| "uk_ua" @Ukrainian ---| "vi" @Vietnamese ---| "zh_cn" @Simplified Chinese --#endregion -- Map the game's built-in language option strings to EID's EID.LanguageMap = { - ["jp"] = "ja", - ["es"] = "es", + ["jp"] = "ja_jp", + ["es"] = "spa", ["de"] = "de", ["fr"] = "fr", ["ru"] = "ru", - ["kr"] = "ko", + ["kr"] = "ko_kr", ["zh"] = "zh_cn", } @@ -72,7 +75,7 @@ function EID:getLanguage() lang = "auto" end if lang == "auto" then - local langToReturn = Options and EID.LanguageMap[Options.Language] or "en" -- Use game language, if available. + local langToReturn = Options and EID.LanguageMap[Options.Language] or EID.DefaultLanguageCode -- Use game language, if available. -- don't do any updating if on a Repentance version before v1.7.9b if Isaac.RunCallback ~= nil then for _, callbackData in pairs(Isaac.GetCallbacks("EID_EVALUATE_AUTO_LANG")) do @@ -92,7 +95,7 @@ end function EID:LoadLanguagePacks(gameVersion) --transformation infos local _, _ = pcall(require, "descriptions." .. gameVersion .. ".transformations") - --languages + --load languages for _, languageCode in ipairs(EID.Languages) do local wasSuccessful, err = pcall(require, "descriptions." .. gameVersion .. "." .. languageCode) if not wasSuccessful and not string.find(err, "not found") then diff --git a/features/eid_tmtrainer.lua b/features/eid_tmtrainer.lua index 708cc657..966fbb70 100644 --- a/features/eid_tmtrainer.lua +++ b/features/eid_tmtrainer.lua @@ -198,5 +198,5 @@ end -- this made more sense when this file was only executed when --luadebug was present -- https://www.youtube.com/watch?v=msDuNZyYAIQ if (debug and os.date("%m/%d") == "04/01") then - EID.descriptions["en"].sacrifice[1][3] = "{{Coin}} 50% chance of winning 1 coin at Sacrifice#75% chance if you're a genetic freak#!!! If you add Kurt Angle to the mix, your chances of winning drastically go down" + EID.descriptions[EID.DefaultLanguageCode].sacrifice[1][3] = "{{Coin}} 50% chance of winning 1 coin at Sacrifice#75% chance if you're a genetic freak#!!! If you add Kurt Angle to the mix, your chances of winning drastically go down" end diff --git a/main.lua b/main.lua index 5fae2f88..fb3b0b1c 100644 --- a/main.lua +++ b/main.lua @@ -631,8 +631,8 @@ function EID:printDescription(desc, cachedID) curName = desc.Name if EID.Config["TranslateItemName"] ~= 2 then local curLanguage = EID.Config["Language"] - if EID:getLanguage() ~= "en" then - EID.Config["Language"] = "en" + if EID:getLanguage() ~= EID.DefaultLanguageCode then + EID.Config["Language"] = EID.DefaultLanguageCode local englishName = desc.PermanentTextEnglish or EID:getObjectName(desc.ObjType, desc.ObjVariant, desc.ObjSubType) EID.Config["Language"] = curLanguage if EID.Config["TranslateItemName"] == 1 then