-Add mist for assist.

-Add 'Buta's_Airboss.lua' for custom Airboss functions.
-Add 'Localizations.lua' for dictionaries of other langs.
-Update MIZ file with 3 AR tankers.
This commit is contained in:
2024-12-14 20:30:38 +08:00
parent b84f0b6eca
commit 26019fe3c1
7 changed files with 9657 additions and 1 deletions
+46
View File
@@ -0,0 +1,46 @@
Localizations = {
defaultLang = 'en',
--英文
["en"] = {
["ERROR: Carrier unit %s is not found in mission."] = "ERROR: Carrier unit %s is not found in mission.",
["world"] = "World",
["welcome"] = "Welcome"
},
--中文
["zh"] = {
["ERROR: Carrier unit %s is not found in mission."] = "错误: 在任务中没有找到航母单位 %s .",
["world"] = "世界",
["welcome"] = "欢迎"
}
}
do
function Localizations:translate(text, langCode)
if not text then return end
if not langCode or type(langCode) ~= 'string' then langCode = self.defaultLang end
langCode = string.lower(langCode)
local langTable = Localizations[langCode]
local result = text
if not langTable then
local defaultLangTable = Localizations[self.defaultLang]
if defaultLangTable then
local result = defaultLangTable[text] or text
end
end
if langTable then
result = langTable[text] or text
end
return result
end
end