diff --git a/WellEater.lua b/WellEater.lua index dccd887..d647ba7 100644 --- a/WellEater.lua +++ b/WellEater.lua @@ -2,7 +2,7 @@ WellEater = WellEater or {} WellEater.WELLEATER_SAVED_VERSION = 1 WellEater.AddonName = "WellEater" WellEater.DisplayName = "|cFFFFFFWell |c0099FFEater|r" -WellEater.Version = "1.0.9" +WellEater.Version = "1.1.0" WellEater.Author = "|c5EFFF5esorochinskiy|r" local NAMESPACE = {} NAMESPACE.settingsDefaults = { diff --git a/WellEater.txt b/WellEater.txt index 5e5edb3..193440c 100644 --- a/WellEater.txt +++ b/WellEater.txt @@ -30,8 +30,8 @@ ## Title: |cFFFFFFWell |c0099FFEater|r ## Author: |c5EFFF5esorochinskiy|r ## APIVersion: 101033 101034 -## Description: Auto eat your preferred meals provided by your inventory after food or drink buff expiration. Provides weapon autoload -## Version: 1.0.9 +## Description: Auto eat your preferred meals provided by your inventory after food or drink buff expiration. Provides weapon autoload and armor autorepair +## Version: 1.1.0 ## SavedVariables: WellEater_Settings ## DependsOn: LibAddonMenu-2.0>=28 diff --git a/lang/de.lua b/lang/de.lua index 738fa62..5e1b918 100644 --- a/lang/de.lua +++ b/lang/de.lua @@ -1,7 +1,7 @@ WellEater = WellEater or {} local L = { generalSetupDescription = "Lässt es Ihnen, nach die Essen- oder Trinken-Bufffs auslaufen, im Inventar" .. - " gefundene Gericht automatisch essen. Auch gibt es eine Waffenautoeinladung", + " gefundene Gericht automatisch essen. Auch gibt es eine Waffenautoeinladung und eine automatische Reparatur", foodQualityHeader = "Die Qualität der suchenden Lebensmittel", foodQualityDescription = "Lasst die Qualität der Lebensmittel auswahlen", foods = { @@ -54,6 +54,32 @@ local L = { repairPercent = "Minimum Verfall %", } -function WellEater:getLocale() - return L +for k, v in pairs(L) do + if type(v) ~= "table" then + local string = "WELLEATER_" .. string.upper(k) + ZO_CreateStringId(string, v) + elseif k == "foods" then + for ik, iv in pairs(v) do + local string = "WELLEATER_FOODS_" .. ik + ZO_CreateStringId(string, iv) + end + end +end + +if (GetCVar('language.2') == 'de') then + local MissingL = {} + for k, v in pairs(WellEater:getLocale()) do + if (not L[k]) then + table.insert(MissingL, k) + L[k] = v + end + end + function WellEater:getLocale() + return L + end + -- for debugging + function WellEater:MissingLocale() + df("[WellEater] Missing strings for '%s'", GetCVar('language.2')) + d(MissingL) + end end diff --git a/lang/en.lua b/lang/en.lua index 5ff522b..066c95f 100644 --- a/lang/en.lua +++ b/lang/en.lua @@ -1,7 +1,7 @@ WellEater = WellEater or {} local L = { generalSetupDescription = "Auto eat your preferred meals provided by your inventory after" .. - " food or drink buff expiration. Provides weapon autoload", + " food or drink buff expiration. Provides weapon autoload and armor autorepair", foodQualityHeader = "Quality of food to search", foodQualityDescription = "Allows to choose the quality of the food", foods = { @@ -52,6 +52,23 @@ local L = { } +for k, v in pairs(L) do + if type(v) ~= "table" then + local string = "WELLEATER_" .. string.upper(k) + ZO_CreateStringId(string, v) + elseif k == "foods" then + for ik, iv in pairs(v) do + local string = "WELLEATER_FOODS_" .. ik + ZO_CreateStringId(string, iv) + end + end +end + function WellEater:getLocale() return L end + + +function WellEater:MissingLocale() + d("[WellEater] Obviously not missing any english strings...") +end \ No newline at end of file diff --git a/lang/ru.lua b/lang/ru.lua index ae35f31..85f534e 100644 --- a/lang/ru.lua +++ b/lang/ru.lua @@ -1,7 +1,7 @@ WellEater = WellEater or {} local L = { generalSetupDescription = "После истечения времени эффектов, которые дает еда, позволяет автоматически съесть" .. - " найденное в инвентаре блюдо. Автоподзарядка оружия", + " найденное в инвентаре блюдо. Автоподзарядка оружия и авторемонт брони", foodQualityHeader = "Качество искомой еды", foodQualityDescription = "Позволяет выбрать качество еды", foods = { @@ -13,8 +13,8 @@ local L = { timerSetupHeader = "Таймер опроса состояния персонажа", timerSetupLabel = "Период опроса, мс", timerSetupLabel_TT = "Как часто состояние персонаж сканируется на наличие усилений (баффов) еды." .. - " Большее значение - меньше нагрузка но большая вероятность оказаться без еды на некоторое время".. - " в критической ситуации", + " Большее значение - меньше нагрузка но большая вероятность оказаться без еды на некоторое время" .. + " в критической ситуации", youEat = "Вы съели: <<1>>", youCharge = "Заряжено <<1>>", @@ -55,6 +55,33 @@ local L = { } -function WellEater:getLocale() - return L +for k, v in pairs(L) do + if type(v) ~= "table" then + local string = "WELLEATER_" .. string.upper(k) + ZO_CreateStringId(string, v) + elseif k == "foods" then + for ik, iv in pairs(v) do + local string = "WELLEATER_FOODS_" .. ik + ZO_CreateStringId(string, iv) + end + end end + +if (GetCVar('language.2') == 'ru') then + local MissingL = {} + for k, v in pairs(WellEater:getLocale()) do + if (not L[k]) then + table.insert(MissingL, k) + L[k] = v + end + end + function WellEater:getLocale() + return L + end + -- for debugging + function WellEater:MissingLocale() + df("[WellEater] Missing strings for '%s'", GetCVar('language.2')) + d(MissingL) + end +end +