Reintroduced EID.LanguageMap for backwards compatibility and bettergame language handling

closes #878
This commit is contained in:
Wofsauge committed 2025-06-11 22:52:11 +02:00
1 parent e20d2fe52d
commit 8957ec63f0
1 file changed
+12 -1
+12 -1
View File
@@ -51,6 +51,17 @@ EID.BreakUtf8CharsLanguage = {
---| "zh_cn" @Simplified Chinese
--#endregion
-- Map the game's built-in language option strings to EID's
EID.LanguageMap = {
["jp"] = "ja",
["es"] = "es",
["de"] = "de",
["fr"] = "fr",
["ru"] = "ru",
["kr"] = "ko",
["zh"] = "zh_cn",
}
---Get the current Language. Defaults to english if none is set.
---@return EID_LanguageCode
function EID:getLanguage()
@@ -61,7 +72,7 @@ function EID:getLanguage()
lang = "auto"
end
if lang == "auto" then
local langToReturn = Options and Options.Language or "en" -- Use game language, if available.
local langToReturn = Options and EID.LanguageMap[Options.Language] or "en" -- 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