"साचा:TemplateBox" च्या विविध आवृत्यांमधील फरक
Content deleted Content added
छो Improved i18n management. |
|||
ओळ १०५:
local i18nTemplateArgs = {}
JSON.strictTypes = true
local contentLangcode = mw.language.getContentLanguage():getCode()
local tdata = JSON:decode('{"description":"","params":{},"sets":[]}')
local extractData = function( pi, number )
local prefix = number or ''
local key, key2, tdkey, tdkey2, ppv, paramVal
local paramKey, paramTable
if number then
Line १२३ ⟶ १२४:
tdkey = key .. '-td'
tdkey2 = key2 .. '-td'
-- Do we have a multilingual item?
if 'table' == type( paramVal
else
paramVal = ppv
end
if 'function' == type( info.extract ) then
if 'string' == type( paramVal ) then
Line २१७ ⟶ २२२:
local argAfter = {}
local isTDArg = false
local containsTD = a:find( '-td', 1, true )
for i, part in ipairs( argSplit ) do
if isTDArg or (containsTD == nil and i > 1) then
-- This is likely a language version
table.insert( argAfter, part )
Line २२८ ⟶ २३४:
end
end
i18nTemplateArgs[argUnitl] = i18nTemplateArgs[
i18nTemplateArgs[argUnitl][argAfter] = v
end
end
end
|