Modulo:Software: differenze tra le versioni
Contenuto cancellato Contenuto aggiunto
prima riga modificata: ora il linguaggio da Wikidata è sempre mostrato quindi occorre togliere Categoria:Software senza linguaggio. Le ulteriori righe modificate sono un piccolo refactoring |
disattivo categorie al di fuori del NS0 |
||
(5 versioni intermedie di 2 utenti non mostrate) | |||
Riga 15:
local UNKNOWN_WD_LICENSE = ""
local UNKNOWN_WD_TOOLKIT = "[[Categoria:Toolkit o framework dell'interfaccia grafica non previsto]]"
local TEMPLATE_UNKNOWN_ARG_WARN = " <span style=\"font-size:75%\">(non in [[Template:Software#Linguaggi|lista]])</span>"
Line 29 ⟶ 30:
-------------------------------- Sgabuzzino ------------------------------------
--[[▼
local function rawProperty(property)▼
* Get the ID from a statement (claim) of type wikibase-id
*▼
* @param table Wikibase claim
* @return string|nil
]]▼
return claim.mainsnak.datavalue and claim.mainsnak.datavalue.value.id
end
Line 114 ⟶ 121:
error("Questa non è una categoria, o è assente la proprietà Wikidata P301")
end
return
end
Line 128 ⟶ 135:
local colon = man and ':' or ''
return "[[" .. colon .. "Categoria:" .. string.format(category, part) .. "]]"
end▼
▲--[[
▲*
▲]]
▲ return free and '[[Categoria:Software libero senza linguaggio]]' or '[[Categoria:Software senza linguaggio]]'
end
Line 163 ⟶ 161:
function p.hasAProprietaryLicense(frame)
return yesNoNil( p._hasAProprietaryLicense( fromItem(frame) ) )
▲end
function p.languageCategories( frame )
return p._languageCategories( fromItem( frame ) )
end
Line 260 ⟶ 262:
if wd_languages then
for i, language in pairs(wd_languages) do
local languageId =
if languageId then
shortWikidataLabel(languageId),
language and p._languageCategory(language, is_free)
)▼
)
improved = true end
Line 344 ⟶ 348:
s = s .. UNKNOWN_WD_LANGUAGE
end
if noLanguages and is_free then
s = s ..
end
end
Line 382 ⟶ 386:
]]
function p._categorize(args)
local ns = mw.title.getCurrentTitle().namespace
local v = args['Categorie']
if v then▼
▲ return mw.ustring.lower(v) ~= 'no'
end▼
end
Line 545 ⟶ 547:
--[[
* Questa licenza è direttamente identificabile?
*
* @TODO: Rewrite in qualche modo più umano.
*
* @param license string Wikidata item
Line 550 ⟶ 554:
]]
function p._singleLicenseType(license)
-- Q1156659 OSI-approved license
-- Q5975031 free software copyleft license
-- Q3943414 free software license
-- Q31202214 proprietary software license
Line 559 ⟶ 565:
* le prossime tre righe riassumino l'*unica* parte piacevole del Lua.
]]
return (license == 'Q3943414' or license == 'Q5975031' or license ==
or (license == 'Q31202214' or license == 'Q218616' or license == 'Q3238057') and PROPRIETARY
or UNKNOWN
end
Line 687 ⟶ 693:
function p._hasALicenseOfType(type, from)
for _, l in pairs( p._licenses(from) ) do
l =
local retrievedType = p._licenseType(l)
return type == retrievedType
end
end
Line 725 ⟶ 733:
local s = ''
for i, l in pairs( p._licenses( from ) ) do
local id =
local name = conf.licenseCategory[ id ]
if name then
local cat = conf.licenseCategoryShorter[id] and LICENSE_CAT_SHORTER or LICENSE_CAT
Line 750 ⟶ 758:
if languages then
for _, l in pairs( languages ) do
l = conf.language[
if l then
s = s .. p._languageCategory(l, free)
Line 757 ⟶ 765:
end
end
elseif free then
s =
end
if missing then
Line 779 ⟶ 787:
if toolkits then
for _, t in pairs( toolkits ) do
t = conf.language[
if t then
s = s .. p._languageCategory(t, free)
|