Modulo:Software: differenze tra le versioni
Contenuto cancellato Contenuto aggiunto
m isFreeSoftware(frame) return 'sì', 'no', nil |
+_isFreeSoftwareByTemplate +_isFreeSoftwareByWikidata |
||
Riga 4:
local p = {}
function p._isFreeSoftwareByTemplate(frame)
local args = frame and getArgs(frame)
if v then
local yep = {['sì'] = true, ['si'] = true, ['no'] = false}▼
v = yep[ mw.ustring.lower(v) ]
end▼
return v
function p._isFreeSoftwareByWikidata()
end
function p._isProprietarySoftwareByWikidata()
end
--[[
Line 11 ⟶ 30:
]]
function p._isFreeSoftware(frame)
local is_wd = p._isFreeSoftwareByWikidata()
▲ local isFreeSoftware = nil
local
local is_tp = p._isFreeSoftwareByTemplate(frame)
▲ local localIsFreeSoftware = args['SoftwareLibero']
local is = nil
if is_wd then
▲ local yep = {['sì'] = true, ['si'] = true, ['no'] = false}
is = true
▲ end
▲ local wikidataIsFreeSoftware = mWikidata._instanceOf({'Q341', 'Q1130645'})
▲ local wikidataIsProprietary = mWikidata._instanceOf({'Q218616'})
end
if
is = false
▲ --end
end
if
is = is_tp
end
--if is_wd == true and isnt_wd == true then
-- Wikidata nonsense
--end
--if is_wd == true and is_tp == true then
-- Local same as Wikidata
--
--if (is_wd == true and is_tp == false) or (isnt_wd == true and is_tp == false) then
-- Free different from Wikidata
--
--if (is_wd ~= nil or isnt_wd ~= nil) and is_tp == false then
-- Free/proprietary read from Wikidata
--
return is
end
|