Jump to content
Wikipedia The Free Encyclopedia

Module:Country2nationality

From Wikipedia, the free encyclopedia
Module documentation[view] [edit] [history] [purge]

Implements {{Country2nationality }}

This module depends on the following other modules:

Usage

{{#invoke:Country2nationality||country_name}}

The above documentation is transcluded from Module:Country2nationality/doc. (edit | history)
Editors can experiment in this module's sandbox (create | mirror) and testcases (create) pages.
Subpages of this module.

 local p = {}
 local data = {
	catalonia = "Catalan",
	['guinea-bissau'] = "Bissau-Guinean",
	kosovo = "Kosovan",
	['timor-leste'] = "East Timorese"
 }

 function p.c2n(country)
	country = mw.ustring.gsub( mw.text.trim(country), "^St. ", "Saint " )
	local iso = require("Module:ISO 3166").code({country})
	if #iso == 2 or #iso == 6 then
		return require("Module:Iso2nationality").i2n(iso)
	elseif data[mw.ustring.lower(country)] then
		return data[mw.ustring.lower(country)]
	end
	return country
 end

 p[''] = function (frame) return p.c2n(frame.args[1]) end

 return p

AltStyle によって変換されたページ (->オリジナル) /