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 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