lang模块初始化可以不提供后面两个参数
This commit is contained in:
@@ -16,8 +16,10 @@ function LANG.init(defaultLang,langList,publicText,pretreatFunc)
|
|||||||
end
|
end
|
||||||
|
|
||||||
--Set public text
|
--Set public text
|
||||||
for _,L in next,langList do
|
if publicText then
|
||||||
for key,list in next,publicText do L[key]=list end
|
for _,L in next,langList do
|
||||||
|
for key,list in next,publicText do L[key]=list end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
--Fallback to default language
|
--Fallback to default language
|
||||||
@@ -28,8 +30,10 @@ function LANG.init(defaultLang,langList,publicText,pretreatFunc)
|
|||||||
end
|
end
|
||||||
|
|
||||||
--Custom pretreatment for each language
|
--Custom pretreatment for each language
|
||||||
for _,L in next,langList do
|
if pretreatFunc then
|
||||||
pretreatFunc(L)
|
for _,L in next,langList do
|
||||||
|
pretreatFunc(L)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function LANG.get(l)
|
function LANG.get(l)
|
||||||
|
|||||||
Reference in New Issue
Block a user