Module:ISO 3166: Difference between revisions

Jump to navigation Jump to search
no edit summary
(Added support for England Wales etc.)
No edit summary
Line 9:
local data = mw.loadData("Module:ISO 3166/data/National/sandbox")
 
--[[----------F I N D N A M E----------]]-- -- Finds the name in the database
 
local function findname(code,cdata,qry)
Line 33:
end
 
--[[----------I S O N A M E----------]]-- -- Find the ISO name of a country/region
 
function isoname(data,code,lang)
Line 51:
end
 
--[[----------S T R I P----------]]-- -- Removes junk from the input
 
function p.strip(text)
Line 72:
text = match
end
text = mw.ustring.upper(text) --Case insensitivity
text = string.gsub(text,"^THE ","") --Remove definite article
text = string.gsub(text,"[%s%-%,%.%(%)%/%\']","") --Remove spacing and punctuation
local accents = {["À"]="A",["Á"]="A",["Â"]="A",["Ã"]="A",["Ä"]="A",["Å"]="A",["Ç"]="C",["È"]="E",["É"]="E",
["Ê"]="E",["Ë"]="E",["Ì"]="I",["Í"]="I",["Î"]="I",["Ï"]="I",["Ñ"]="N",["Ò"]="O",["Ó"]="O",
Line 82:
end
 
--[[----------P . C A L L S T R I P ---------]]-- -- Calls P.strip but using Module:Arguments
 
function p.callstrip(frame)
Line 92:
end
 
--[[----------P . L U A C O D E---------]]-- -- Makes the ISO code of a country
 
function p.luacode(args)
Line 148:
end
 
--[[----------P . C O D E---------]]-- -- Calls P.Luacode but using Module:Arguments
 
function p.code(frame)
Line 156:
end
 
--[[----------P . N U M E R I C---------]]-- -- Calls P.Luacode but using Module:Arguments and setting it to output a numeric value
 
function p.numeric(frame)
Line 168:
end
--[[----------P . L U A N A M E---------]]-- -- Makes the ISO/common name of a country
function p.luaname(args)
Line 207:
end
 
--[[----------P . N A M E---------]]-- -- Calls P.Luaname but using Module:Arguments
 
function p.name(frame)
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.

Navigation menu