Modulo:Software: differenze tra le versioni

Contenuto cancellato Contenuto aggiunto
ora vi è soltanto Categoria:Software libero senza linguaggio e non più Categoria:Software senza linguaggio poiché solo il software libero necessita di un linguaggio - come da discussione
disattivo categorie al di fuori del NS0
 
(4 versioni intermedie di 2 utenti non mostrate)
Riga 30:
-------------------------------- Sgabuzzino ------------------------------------
 
--[[
local function rawProperty(property)
* Get the ID from a statement (claim) of type wikibase-id
return mWikidata._formatStatement(property, {formatting = 'raw'})
*
* @param table Wikibase claim
* @return string|nil
]]
local function rawPropertystatementQID(property claim )
return claim.mainsnak.datavalue and claim.mainsnak.datavalue.value.id
end
 
Line 115 ⟶ 121:
error("Questa non è una categoria, o è assente la proprietà Wikidata P301")
end
return rawPropertystatementQID(from)
end
 
Line 155 ⟶ 161:
function p.hasAProprietaryLicense(frame)
return yesNoNil( p._hasAProprietaryLicense( fromItem(frame) ) )
end
 
function p.languageCategories( frame )
return p._languageCategories( fromItem( frame ) )
end
 
Line 252 ⟶ 262:
if wd_languages then
for i, language in pairs(wd_languages) do
local languageId = rawPropertystatementQID(language)
if languageId then
language = conf.language[languageId]
outputLanguages[languageId] = outputLanguage(
shortWikidataLabel(outputLanguages[languageId),] = outputLanguage(
shortWikidataLabel(languageId),
language and p._languageCategory(language, is_free)
)
)
improved = true
)end
end
 
Line 374 ⟶ 386:
]]
function p._categorize(args)
local ns = mw.title.getCurrentTitle().namespace
local v = args['Categorie']
return ns == 0 and (v == nil or mw.ustring.lower(v) ~= 'no')
if v then
return mw.ustring.lower(v) ~= 'no'
end
return true
end
 
Line 537 ⟶ 547:
--[[
* Questa licenza è direttamente identificabile?
*
* @TODO: Rewrite in qualche modo più umano.
*
* @param license string Wikidata item
Line 542 ⟶ 554:
]]
function p._singleLicenseType(license)
-- Q1156659 OSI-approved license
-- Q5975031 free software copyleft license
-- Q3943414 free software license
-- Q31202214 proprietary software license
Line 551 ⟶ 565:
* le prossime tre righe riassumino l'*unica* parte piacevole del Lua.
]]
return (license == 'Q3943414' or license == 'Q5975031' or license == 'Q1156659') and FREE
or (license == 'Q31202214' or license == 'Q218616' or license == 'Q3238057') and PROPRIETARY
or UNKNOWN
end
 
Line 679 ⟶ 693:
function p._hasALicenseOfType(type, from)
for _, l in pairs( p._licenses(from) ) do
l = rawPropertystatementQID(l)
if vl then
local retrievedType = p._licenseType(l)
if type ~= UNKNOWN then
returnif type ~== retrievedTypeUNKNOWN then
return type == retrievedType
end
end
end
Line 717 ⟶ 733:
local s = ''
for i, l in pairs( p._licenses( from ) ) do
local id = rawPropertystatementQID( l ) -- can be nil but don't care
local name = conf.licenseCategory[ id ]
if name then
local cat = conf.licenseCategoryShorter[id] and LICENSE_CAT_SHORTER or LICENSE_CAT
Line 742 ⟶ 758:
if languages then
for _, l in pairs( languages ) do
l = conf.language[ rawPropertystatementQID(l) ]
if l then
s = s .. p._languageCategory(l, free)
Line 749 ⟶ 765:
end
end
elseif is_freefree then
s = FREE_WITHOUT_LANGUAGE
end
Line 771 ⟶ 787:
if toolkits then
for _, t in pairs( toolkits ) do
t = conf.language[ rawPropertystatementQID( t ) ] -- the ID can be nil but don't care
if t then
s = s .. p._languageCategory(t, free)