Difference between revisions of "Module:Extension"
Jump to navigation
Jump to search
getFormattedLicense
>Ricordisamoa (+ Apache-2.0) |
>Ricordisamoa (getFormattedLicense) |
||
Line 31: | Line 31: | ||
['MPL-1.0'] = { 'Mozilla Public License 1.0', 'MPL' }, | ['MPL-1.0'] = { 'Mozilla Public License 1.0', 'MPL' }, | ||
['MPL-2.0'] = { 'Mozilla Public License 2.0', 'MPL' }, | ['MPL-2.0'] = { 'Mozilla Public License 2.0', 'MPL' }, | ||
['Apache-2.0'] = { 'Apache License 2.0', 'Apache' }, | ['Apache-2.0'] = { '[http://www.apache.org/licenses/LICENSE-2.0 Apache License 2.0]', 'Apache' }, | ||
} | } | ||
local types = { | local types = { | ||
Line 140: | Line 140: | ||
else | else | ||
return tcat( 'Extensions with unknown license' ) | return tcat( 'Extensions with unknown license' ) | ||
end | |||
end | |||
local function getFormattedLicense( str ) | |||
local cnf = licenses[str] | |||
if cnf then | |||
return cnf[1] | |||
else | |||
return str | |||
end | end | ||
end | end | ||
Line 176: | Line 185: | ||
function p.getLicenseCategory( frame ) | function p.getLicenseCategory( frame ) | ||
return getLicenseCategory( frame.args[1] ) | return getLicenseCategory( frame.args[1] ) | ||
end | |||
function p.getFormattedLicense( frame ) | |||
return getFormattedLicense( frame.args[1] ) | |||
end | end | ||
return p | return p |