diff --git a/descriptions/rep/en_us.lua b/descriptions/rep/en_us.lua index e5a558c9..dd5fe833 100644 --- a/descriptions/rep/en_us.lua +++ b/descriptions/rep/en_us.lua @@ -1041,3 +1041,12 @@ EID.descriptions[languageCode].AchievementWarningText = "Achievements are disabl EID.descriptions[languageCode].OldGameVersionWarningText = "Your version of Repentance is not up-to-date!#Only the newest version is officially supported#(This warning can be disabled in the config)" EID.descriptions[languageCode].ModdedRecipesWarningText = "Modded items could make the crafting recipe calculation inaccurate!#Use the No Recipes display mode or turn off the Bag of Crafting display if your recipes are incorrect#(This warning can be disabled in the config)" + + +-- If Debug enabled, add overwrite tables to the languagepack in order for the language completion script to be able to compare them +if EID.enableDebug then + EID.descriptions[languageCode].repCollectibles = repCollectibles + EID.descriptions[languageCode].repTrinkets = repTrinkets + EID.descriptions[languageCode].repCards = repCards + EID.descriptions[languageCode].repPills = repPills +end \ No newline at end of file diff --git a/descriptions/rep/fr.lua b/descriptions/rep/fr.lua index 4e4e617d..cd6173c2 100644 --- a/descriptions/rep/fr.lua +++ b/descriptions/rep/fr.lua @@ -668,3 +668,12 @@ EID.descriptions[languageCode].CraftingRoomContent = "Salle:" EID.descriptions[languageCode].CraftingFloorContent = "Étage:" EID.descriptions[languageCode].CraftingResults = "Results:#(Scroll: hold {{CONFIG_BoC_Toggle}} + {{ButtonY}} {{ButtonA}})" EID.descriptions[languageCode].CraftingBagModError = "!!! {{ColorRed}}ERROR:#{{ColorRed}}This feature currently does not support games with modded items installed" + + +-- If Debug enabled, add overwrite tables to the languagepack in order for the language completion script to be able to compare them +if EID.enableDebug then + EID.descriptions[languageCode].repCollectibles = repCollectibles + EID.descriptions[languageCode].repTrinkets = repTrinkets + EID.descriptions[languageCode].repCards = repCards + EID.descriptions[languageCode].repPills = repPills +end diff --git a/descriptions/rep/it.lua b/descriptions/rep/it.lua index 8da85914..a0c9e265 100644 --- a/descriptions/rep/it.lua +++ b/descriptions/rep/it.lua @@ -664,3 +664,12 @@ EID.descriptions[languageCode].CraftingRoomContent = "Stanza:" EID.descriptions[languageCode].CraftingFloorContent = "Piano:" EID.descriptions[languageCode].CraftingResults = "Risultato:#(Scorri: premi {{CONFIG_BoC_Toggle}} + {{ButtonY}} {{ButtonA}})" EID.descriptions[languageCode].CraftingBagModError = "!!! {{ColorRed}}ERRORE:#{{ColorRed}}Questa feature non supporta certe mod!" + + +-- If Debug enabled, add overwrite tables to the languagepack in order for the language completion script to be able to compare them +if EID.enableDebug then + EID.descriptions[languageCode].repCollectibles = repCollectibles + EID.descriptions[languageCode].repTrinkets = repTrinkets + EID.descriptions[languageCode].repCards = repCards + EID.descriptions[languageCode].repPills = repPills +end diff --git a/descriptions/rep/ko_kr.lua b/descriptions/rep/ko_kr.lua index 1169f624..a01e2fa7 100644 --- a/descriptions/rep/ko_kr.lua +++ b/descriptions/rep/ko_kr.lua @@ -1092,4 +1092,13 @@ EID.descriptions[languageCode].AchievementWarningText = "지금 모드를 적용 EID.descriptions[languageCode].OldGameVersionWarningText = "리펜턴스가 최신 버전이 아닙니다!#최신 버전이 아닐 경우 모드 오류가 발생할 수 있습니다.#(config 설정을 수정하여 메세지를 비활성화 할 수 있습니다.)" -EID.descriptions[languageCode].ModdedRecipesWarningText = "아이템 추가 모드나 아이템 배열 변경 모드가 적용되어 있을 경우 조합법이 일치하지 않을 수 있습니다.#조합법 설명을 숨기거나 DisplayBagOfCrafting를 No Recipe로 설정해 주세요.#(config 설정을 수정하여 해당 메세지를 비활성화 할 수 있습니다.)" \ No newline at end of file +EID.descriptions[languageCode].ModdedRecipesWarningText = "아이템 추가 모드나 아이템 배열 변경 모드가 적용되어 있을 경우 조합법이 일치하지 않을 수 있습니다.#조합법 설명을 숨기거나 DisplayBagOfCrafting를 No Recipe로 설정해 주세요.#(config 설정을 수정하여 해당 메세지를 비활성화 할 수 있습니다.)" + + +-- If Debug enabled, add overwrite tables to the languagepack in order for the language completion script to be able to compare them +if EID.enableDebug then + EID.descriptions[languageCode].repCollectibles = repCollectibles + EID.descriptions[languageCode].repTrinkets = repTrinkets + EID.descriptions[languageCode].repCards = repCards + EID.descriptions[languageCode].repPills = repPills +end diff --git a/descriptions/rep/pl.lua b/descriptions/rep/pl.lua index 57c52f27..dfc1649a 100644 --- a/descriptions/rep/pl.lua +++ b/descriptions/rep/pl.lua @@ -657,3 +657,12 @@ EID.descriptions[languageCode].CraftingBagContent = "torbie:" EID.descriptions[languageCode].CraftingRoomContent = "pokoju:" EID.descriptions[languageCode].CraftingResults = "Wyniki:#(Przewiń: Trzymaj TAB + Strzał △/▽)" EID.descriptions[languageCode].CraftingBagModError = "!!! {{ColorRed}}BŁĄD:#{{ColorRed}}Ta funkcja nie wspiera obecnie zmodowanych przedmiotów" + + +-- If Debug enabled, add overwrite tables to the languagepack in order for the language completion script to be able to compare them +if EID.enableDebug then + EID.descriptions[languageCode].repCollectibles = repCollectibles + EID.descriptions[languageCode].repTrinkets = repTrinkets + EID.descriptions[languageCode].repCards = repCards + EID.descriptions[languageCode].repPills = repPills +end diff --git a/descriptions/rep/pt_br.lua b/descriptions/rep/pt_br.lua index 83ebd808..7c4e151f 100644 --- a/descriptions/rep/pt_br.lua +++ b/descriptions/rep/pt_br.lua @@ -680,3 +680,12 @@ EID.descriptions[languageCode].CraftingBagModError = "!!! {{ColorRed}}ERROR:#{{C EID.descriptions[languageCode].AchievementWarningTitle = "{{ColorYellow}}!!! ALERTA !!!" EID.descriptions[languageCode].AchievementWarningText = "Conquista estão desabilitadas!#Para possibilitar a progressão e as conquistas, é preciso primeiro matar a Mãe (Depths II) sem nenhum mods habilitado" + + +-- If Debug enabled, add overwrite tables to the languagepack in order for the language completion script to be able to compare them +if EID.enableDebug then + EID.descriptions[languageCode].repCollectibles = repCollectibles + EID.descriptions[languageCode].repTrinkets = repTrinkets + EID.descriptions[languageCode].repCards = repCards + EID.descriptions[languageCode].repPills = repPills +end diff --git a/descriptions/rep/ru.lua b/descriptions/rep/ru.lua index 2f6ba268..d3604f56 100644 --- a/descriptions/rep/ru.lua +++ b/descriptions/rep/ru.lua @@ -938,3 +938,12 @@ EID.descriptions[languageCode].AchievementWarningTitle = "{{ColorYellow}}!!! В EID.descriptions[languageCode].AchievementWarningText = "Достижения отключены!#Чтобы включить прогресс и достижения, вам сначала нужно убить Маму (Глубины II) без включенных модов#(Если вы уже убили Маму, то это сообщение баг и вы можете его игнорировать)#(Это предупреждение можно выключить в конфиге)" EID.descriptions[languageCode].OldGameVersionWarningText = "Ваша версия Repentance не обновлена!#Только самая последняя версия официально поддерживается#(Это предупреждение можно выключить в конфиге)" EID.descriptions[languageCode].ModdedRecipesWarningText = "Предметы из модов могут сделать расчёт крафтов неточным!#Используйте режим отображения \"No Recipes\" или отключите отображение Крафт-Мешка, если ваши рецепты неверны#(Это предупреждение можно выключить в конфиге)" + + +-- If Debug enabled, add overwrite tables to the languagepack in order for the language completion script to be able to compare them +if EID.enableDebug then + EID.descriptions[languageCode].repCollectibles = repCollectibles + EID.descriptions[languageCode].repTrinkets = repTrinkets + EID.descriptions[languageCode].repCards = repCards + EID.descriptions[languageCode].repPills = repPills +end diff --git a/descriptions/rep/spa.lua b/descriptions/rep/spa.lua index c95d98de..329d2c12 100644 --- a/descriptions/rep/spa.lua +++ b/descriptions/rep/spa.lua @@ -1025,3 +1025,12 @@ EID.descriptions[languageCode].MCM = { DemoObjectTransformation = "Transformación demostrativa", DemoObjectText = "Este texto está en español#¡Una larga y genial descripción para demostrar los saltos de línea causados por la anchura de texto de EID!#\1 Esta linea también es genial#Esta linea te ama {{Heart}}", } + + +-- If Debug enabled, add overwrite tables to the languagepack in order for the language completion script to be able to compare them +if EID.enableDebug then + EID.descriptions[languageCode].repCollectibles = repCollectibles + EID.descriptions[languageCode].repTrinkets = repTrinkets + EID.descriptions[languageCode].repCards = repCards + EID.descriptions[languageCode].repPills = repPills +end diff --git a/descriptions/rep/tr_tr.lua b/descriptions/rep/tr_tr.lua index abf39c28..d72e299c 100644 --- a/descriptions/rep/tr_tr.lua +++ b/descriptions/rep/tr_tr.lua @@ -670,3 +670,13 @@ EID.descriptions[languageCode].CraftingBagContent = "Çantadaki:" EID.descriptions[languageCode].CraftingRoomContent = "Odadaki:" EID.descriptions[languageCode].CraftingResults = "Sonuçlar:#(Kaydır: TAB(basılı tut) + Ateş △/▽)" EID.descriptions[languageCode].CraftingBagModError = "!!! {{ColorRed}}HATA:#{{ColorRed}}Bu özellik şu anda modlu itemleri desteklemiyor" + + + +-- If Debug enabled, add overwrite tables to the languagepack in order for the language completion script to be able to compare them +if EID.enableDebug then + EID.descriptions[languageCode].repCollectibles = repCollectibles + EID.descriptions[languageCode].repTrinkets = repTrinkets + EID.descriptions[languageCode].repCards = repCards + EID.descriptions[languageCode].repPills = repPills +end \ No newline at end of file diff --git a/descriptions/rep/zh_cn.lua b/descriptions/rep/zh_cn.lua index 1e347c61..9ddee260 100644 --- a/descriptions/rep/zh_cn.lua +++ b/descriptions/rep/zh_cn.lua @@ -980,3 +980,12 @@ EID.descriptions[languageCode].AchievementWarningText = "成就已禁用!#为 EID.descriptions[languageCode].OldGameVersionWarningText = "你的忏悔版本不是最新的!#只有官方最新版才支持这一功能#(这条警告可以在设置中禁用)" EID.descriptions[languageCode].ModdedRecipesWarningText = "含有模组的道具可能会使合成配方计算不准确!#如果你的配方不正确,请使用无配方模式或者关闭合成袋的显示#(这条警告可以在设置中禁用)" + + +-- If Debug enabled, add overwrite tables to the languagepack in order for the language completion script to be able to compare them +if EID.enableDebug then + EID.descriptions[languageCode].repCollectibles = repCollectibles + EID.descriptions[languageCode].repTrinkets = repTrinkets + EID.descriptions[languageCode].repCards = repCards + EID.descriptions[languageCode].repPills = repPills +end diff --git a/eid_api.lua b/eid_api.lua index 69b87463..fdeeb1ad 100644 --- a/eid_api.lua +++ b/eid_api.lua @@ -1075,6 +1075,7 @@ end function EID:setModIndicatorName(newName) EID.ModIndicator[EID._currentMod].Name = newName end + -- Set an icon for the mod which will be displayed next to the item name function EID:setModIndicatorIcon(iconMarkup, override) if override == nil then override = true end -- overide previous value if not specified diff --git a/eid_debugging.lua b/eid_debugging.lua index e51fbee3..ac200186 100644 --- a/eid_debugging.lua +++ b/eid_debugging.lua @@ -1,4 +1,55 @@ local showDebugChars = false + + +-- check integrity of language files + +local languageFilesToCheck = {"spa"} -- EID.Languages -- single file check {"ko_kr"} + +-- count en_us entries for stats +local count = 0 +function EID:countEntries(t) + for k, v in pairs(t) do + count = count + 1 + if type(t[k]) == "table" then + EID:countEntries(t[k]) + end + end +end +EID:countEntries(EID.descriptions["en_us"]) +local enUSEntries = count +print("en_us entries: "..enUSEntries) + +for i,lang in ipairs(languageFilesToCheck) do + print("Now checking integrity of languagefile: "..lang) + -- Generic function to compare two tables + function EID:compareTables(table1, table2, prevKey, progress) + for k, v in pairs(table1) do + progress[1] = progress[1] + 1 + if not table2[k] then + print(" Table '"..prevKey.."' does not contain key: "..k) + progress[2] = progress[2] + 1 + elseif type(table2[k]) == "table" then + EID:compareTables(table1[k], table2[k], k, progress) + end + end + end + local progress = {0, 0} + EID:compareTables(EID.descriptions["en_us"], EID.descriptions[lang], lang, progress) + + local errors = (enUSEntries - progress[1])-progress[2] + print("Errors found: "..errors .." / "..enUSEntries) + print("Translation progress: "..((enUSEntries-errors)/enUSEntries*100).."%") + +end + + + + + + + + + local charsToDebug = { "!!! EID DEBUG MODE ACTIVATED !!!", -- Header "ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz 1234567890", -- Basic chars diff --git a/main.lua b/main.lua index 49a85b52..ff38fcac 100644 --- a/main.lua +++ b/main.lua @@ -3,7 +3,7 @@ EID = RegisterMod("External Item Descriptions", 1) EID.GameVersion = "ab+" EID.Languages = {"en_us", "en_us_detailed", "fr", "pt", "pt_br", "ru", "spa", "it", "bul", "pl", "de", "tr_tr", "ko_kr", "zh_cn"} EID.descriptions = {} -- Table that holds all translation strings -local enableDebug = false +EID.enableDebug = false local game = Game() require("eid_config") @@ -1126,6 +1126,6 @@ if EID.MCMLoaded or REPENTANCE then EID:AddCallback(ModCallbacks.MC_PRE_GAME_EXIT, SaveGame) end -if enableDebug then +if EID.enableDebug then require("eid_debugging") end \ No newline at end of file