Modul:NativeLabels
Documentația acestui modul poate fi creată la Modul:NativeLabels/doc
local p = {}
local join = require('Modul:Separated entries')._main
local function fromFrame(frame)
local q = frame.args.q or mw.wikibase.getEntityIdForCurrentPage()
local nativeLabelStatements = mw.wikibase.getBestStatements(q, 'P1705')
if not nativeLabelStatements or #nativeLabelStatements == 0 then return '' end
local vals = {}
for _,eachStatement in ipairs(nativeLabelStatements) do
if eachStatement.type == 'statement' and eachStatement.mainsnak.snaktype == 'value' and eachStatement.mainsnak.datavalue.value.language ~= 'ro' then
table.insert(vals, 'în ' .. mw.getCurrentFrame():expandTemplate{title = eachStatement.mainsnak.datavalue.value.language, args = { eachStatement.mainsnak.datavalue.value.text} })
end
end
vals.separator = '; '
return join(vals)
end
p.fromFrame = fromFrame
return p