Module:Italian regions: Difference between revisions
Appearance
Content deleted Content added
m Changed protection level for "Module:Italian regions": few uses ([Edit=Require autoconfirmed or confirmed access] (indefinite) [Move=Require autoconfirmed or confirmed access] (indefinite)) |
Replace Module:No globals with require( "strict" ) |
||
Line 1: | Line 1: | ||
require('strict') |
|||
local p = {} |
local p = {} |
||
local getArgs = require('Module:Arguments').getArgs |
local getArgs = require('Module:Arguments').getArgs |
||
Line 23: | Line 25: | ||
VEN = {name="Veneto", coa="Flag of Veneto.png"}, |
VEN = {name="Veneto", coa="Flag of Veneto.png"}, |
||
} |
} |
||
require('Module:No globals') |
|||
function p.main(frame) |
function p.main(frame) |
Revision as of 19:00, 21 October 2022
![]() | This module is rated as beta, and is ready for widespread use. It is still new and should be used with some caution to ensure the results are as expected. |
![]() | This module is subject to page protection. It is a highly visible module in use by a very large number of pages, or is substituted very frequently. Because vandalism or mistakes would affect many pages, and even trivial editing might cause substantial load on the servers, it is protected from editing. |
Usage
Linked name
{{#invoke:Italian regions|main|FVG}}
Unlinked name
{{#invoke:Italian regions|main|link=false|FVG}}
Friuli – Venezia Giulia
Coat of arms
{{#invoke:Italian regions|coat_of_arms|FVG}}
Regione-Friuli-Venezia-Giulia-Stemma.png
Used by the following templates
Testing
Test cases on Module talk:Italian regions/testcases.
require('strict')
local p = {}
local getArgs = require('Module:Arguments').getArgs
local data = {
ABR = {name="Abruzzo", coa="Regione-Abruzzo-Stemma.svg"},
BAS = {name="Basilicata", coa="Regione-Basilicata-Stemma.svg"},
CAL = {name="Calabria", coa="Coat_of_arms_of_Calabria.svg"},
CAM = {name="Campania", coa=""},
EMR = {name="Emilia-Romagna", coa="Regione-Emilia-Romagna-Stemma.png"},
FVG = {name="Friuli – Venezia Giulia", coa="Regione-Friuli-Venezia-Giulia-Stemma.png"},
LAZ = {name="Lazio", coa="Lazio-Stemma.png"},
LIG = {name="Liguria", coa="Regione-Liguria-Stemma.png"},
LOM = {name="Lombardy", coa="Regione-Lombardia-Stemma.svg"},
MAR = {name="Marche", coa="Coat of arms of Marche.svg"},
MOL = {name="Molise", coa="Regione-Molise-Stemma.svg"},
PMN = {name="Piedmont", coa="Regione-Piemonte-Stemma.svg"},
PUG = {name="Apulia", coa="Regione Puglia-Stemma.png"},
SAR = {name="Sardinia", coa="Sardegna-Stemma.svg"},
SIC = {name="Sicily", coa="Regione-Sicilia-Stemma.png"},
TOS = {name="Tuscany", coa="Regione-Toscana-Stemma.png"},
TAA = {name="Trentino-Alto Adige/Südtirol", coa="Coat of arms of Trentino-South Tyrol.svg"},
UMB = {name="Umbria", coa="Regione-Umbria-Stemma.svg"},
VAO = {name="Aosta Valley", coa="Valle_d%27Aosta-Stemma.svg"},
VEN = {name="Veneto", coa="Flag of Veneto.png"},
}
function p.main(frame)
local args = getArgs(frame)
local p_data = data[args[1]]
local config = frame.args
if p_data then
if config.link=='false' then
return p_data.name
else
return '[[' .. p_data.name .. ']]'
end
end
end
function p.coat_of_arms(frame)
local args = getArgs(frame)
local p_data = data[args[1]]
if p_data then
return p_data.coa
end
end
return p