lang模块初始化可以不提供后面两个参数

This commit is contained in:
MrZ626
2021-10-04 01:02:34 +08:00
parent bded1eab15
commit 639df50a31

View File

@@ -16,9 +16,11 @@ function LANG.init(defaultLang,langList,publicText,pretreatFunc)
end
--Set public text
if publicText then
for _,L in next,langList do
for key,list in next,publicText do L[key]=list end
end
end
--Fallback to default language
for name,L in next,langList do
@@ -28,9 +30,11 @@ function LANG.init(defaultLang,langList,publicText,pretreatFunc)
end
--Custom pretreatment for each language
if pretreatFunc then
for _,L in next,langList do
pretreatFunc(L)
end
end
function LANG.get(l)
if not langList[l]then