İçeriğe atla

Modül:ISO 639

Vikikaynak, özgür kütüphane

Bu modül için bir Modül:ISO 639/belge belgelendirmesi oluşturabilirsiniz

--[=[
Module description
]=]

local p = {} --p stands for package

--[=[
Get the language name, in English, for a given ISO 639 (-1, -2 or -3) code
Not all languages are in here, that's laziness rather than design

Returns nil if the language is not in the lookup table.
]=]
function p.language_name(code)
	local langs = {
		en = "English",
		enm = "Middle English",
		ang = "Old English",
		ja = "Japanese",
		de = "German",
		fr = "French",
		es = "Spanish",
		zh = "Chinese",
		['zh-hant'] = "Chinese", -- should be different?
		['zh-hans'] = "Chinese",
		it = "Italian",
		nl = "Dutch",
		el = "Greek",
		grc = "Ancient Greek",
		la = "Latin",
		pl = "Polish",
		cs = "Czech",
		cy = "Welsh",
		sco = "Scots",
		ta = "Tamil",
		ain = "Ainu",
		fa = "Persian",
		ar = "Arabic",
		sv = "Swedish",
		kos = "Kosraean",
		nb = "Norwegian Bokmål",
		sa = "Sanskrit",
		he = "Hebrew",
		mnc = "Manchu",
		sr = "Serbian",
		te = "Telugu",
		th = "Thai",
		wuu = "Wu",
		yue = "Yue",
	}
	return langs[code]
end

return p