This module is rated as beta. It is considered ready for widespread use, but as it is still relatively new, it should be applied with some caution to ensure results are as expected.
This module depends on the following other modules:
localp={}localISO_3166=require('Module:ISO 3166')localfunctionltrim(s)returns:match'^%s*(.*)'endlocalfunctionsplit_with_comma(str)localfields={}forfieldinstr:gmatch('([^,]+)')dofields[#fields+1]=ltrim(field)endreturnfieldsendlocalfunctionto_ISO_3166(country)fori=1,#countrydolocalshortname=ISO_3166.name({country[i]})ifshortname~=""thencountry[i]=shortnameendendreturncountryendlocalfunctionto_str(arr)localcstring=""fori=1,#arr-1docstring=cstring..ltrim(arr[i])..", "endcstring=cstring..ltrim(arr[#arr])returncstringendfunctionp.countrynames(frame)-- local test = frame.args[1] .. ", " .. frame.args.property-- return test-- change comma list to arrayCountryarray=split_with_comma(frame.args[1])-- put each array entry {as a table} through Module:ISO 3166. If the result is null, keep original entryto_ISO_3166(Countryarray)-- change array back to comma stringCommastring=to_str(Countryarray)returnCommastringendreturnp