跳转到内容

模組:Language-zh/data

维基百科,自由的百科全书
local U = mw.ustring.char

-- Diacritics, from the [[Combining Diacritical Marks]] block.
local grave        = U(0x300)
local acute        = U(0x301)
local circumflex   = U(0x302)
local tilde        = U(0x303)
local macron       = U(0x304)
local breve        = U(0x306)
local dot          = U(0x307)
local diaeresis    = U(0x308)
local double_acute = U(0x30B)
local caron        = U(0x30C)
local double_grave = U(0x30F)
local invbreve     = U(0x311)
local dot_below    = U(0x323)
local undertie     = U(0x35C)

--[[
    
	This is a table of Wiktionary language codes with data belonging to them.
	Name is the "canonical name" used on Wiktionary.
	Article is the Wikipedia article.
	Script is the ISO 15924 code.
]]
local data = {
	["languages"] = {
		["ab"] = {
			["name"] = "阿布哈兹语",
			["article"] = "阿布哈兹语",
		},
		["ang"] = {
			["name"] = "古英语",
			["article"] = "古英语",
			-- Remove macrons, acutes, and overdots
			["replacements"] = {
				decompose = true,
				from = { "[" .. macron .. acute .. dot .. "]" },
			},
		},
		["ar"] = {
			["name"] = "阿拉伯语",
			["article"] = "阿拉伯语",
			["direction"] = "rtl", -- Should be in the script data module.
			["replacements"] = {
				-- ālif with wasla is replaced by ālif;
				[U(0x0671)] = U(0x0627),
				-- taṭwīl, fatḥatan, ḍammatan, kasratan,
				-- fatḥa, ḍamma, kasra,
				-- shadda, sukūn, and superscript (dagger) ālif are removed.
				["["..U(0x0640)..U(0x064B)..U(0x064C)..U(0x064D)
					..U(0x064E)..U(0x064F)..U(0x0650)
					..U(0x0651)..U(0x0652)..U(0x0670).."]"] = "",
			},
		},
		["ara"] = {
			["name"] = "阿拉伯语",
			["article"] = "阿拉伯语",
			["direction"] = "rtl", -- Should be in the script data module.
			["replacements"] = {
				-- ālif with wasla is replaced by ālif;
				[U(0x0671)] = U(0x0627),
				-- taṭwīl, fatḥatan, ḍammatan, kasratan,
				-- fatḥa, ḍamma, kasra,
				-- shadda, sukūn, and superscript (dagger) ālif are removed.
				["["..U(0x0640)..U(0x064B)..U(0x064C)..U(0x064D)
					..U(0x064E)..U(0x064F)..U(0x0650)
					..U(0x0651)..U(0x0652)..U(0x0670).."]"] = "",
			},
		},
		["arb"] = {
			["name"] = "现代标准阿拉伯语",
			["article"] = "现代标准阿拉伯语",
			["direction"] = "rtl", -- Should be in the script data module.
			["replacements"] = {
				-- ālif with wasla is replaced by ālif;
				[U(0x0671)] = U(0x0627),
				-- taṭwīl, fatḥatan, ḍammatan, kasratan,
				-- fatḥa, ḍamma, kasra,
				-- shadda, sukūn, and superscript (dagger) ālif are removed.
				["["..U(0x0640)..U(0x064B)..U(0x064C)..U(0x064D)
					..U(0x064E)..U(0x064F)..U(0x0650)
					..U(0x0651)..U(0x0652)..U(0x0670).."]"] = "",
			},
		},
		["apc"] = {
			["name"] = "黎凡特阿拉伯语",
			["article"] = "黎凡特阿拉伯语",
			["direction"] = "rtl", -- Should be in the script data module.
			["replacements"] = {
				-- ālif with wasla is replaced by ālif;
				[U(0x0671)] = U(0x0627),
				-- taṭwīl, fatḥatan, ḍammatan, kasratan,
				-- fatḥa, ḍamma, kasra,
				-- shadda, sukūn, and superscript (dagger) ālif are removed.
				["["..U(0x0640)..U(0x064B)..U(0x064C)..U(0x064D)
					..U(0x064E)..U(0x064F)..U(0x0650)
					..U(0x0651)..U(0x0652)..U(0x0670).."]"] = "",
			},
		},
		["ajp"] = {
			["name"] = "南黎凡特阿拉伯语",
			["article"] = "南黎凡特阿拉伯语",
			["direction"] = "rtl", -- Should be in the script data module.
			["replacements"] = {
				-- ālif with wasla is replaced by ālif;
				[U(0x0671)] = U(0x0627),
				-- taṭwīl, fatḥatan, ḍammatan, kasratan,
				-- fatḥa, ḍamma, kasra,
				-- shadda, sukūn, and superscript (dagger) ālif are removed.
				["["..U(0x0640)..U(0x064B)..U(0x064C)..U(0x064D)
					..U(0x064E)..U(0x064F)..U(0x0650)
					..U(0x0651)..U(0x0652)..U(0x0670).."]"] = "",
			},
		},
		["av"] = {
			["name"] = "阿瓦尔语",
			["article"] = "阿瓦尔语",
		},
		["be"] = {
			["name"] = "白俄罗斯语",
			["article"] = "白俄罗斯语",
			["replacements"] = { [acute] = "", },
		},
		["bn"] = {
			["name"] = "孟加拉语",
			["article"] = "孟加拉语",
		},
		["bua"] = {
			["name"] = "布里亚特语",
			["article"] = "布里亚特语",
		},
		["cel-pro"] = {							-- Incorrect tag
			["name"] = "原始凯尔特语",
			["article"] = "原始凯尔特语",
			["Wikipedia_code"] = "cel-x-proto",
		},
		["cel-x-proto"] = {
			["name"] = "原始凯尔特语",
			["article"] = "原始凯尔特语",
		},
		["cel-bry-pro"] = {						-- Incorrect tag
			["name"] = "原始布立吞语",
			["article"] = "古布立吞语",
			["type"] = "reconstructed",
		},
		["cu"] = {
			["name"] = "古教会斯拉夫语",
			["article"] = "古教会斯拉夫语",
		},
		["de"] = {
			["name"] = "德语",
			["article"] = "德语",
		},
		["en"] = {
			["name"] = "英语",
			["article"] = "英语",
		},
		["es"] = {
			["name"] = "西班牙语",
			["article"] = "西班牙语",
		},
		["egy"] = {
			["name"] = "埃及语",
			["article"] = "埃及语",
		},
		["fa"] = {
			["name"] = "波斯语",
			["article"] = "波斯语",
		},
		["fr"] = {
			["name"] = "法语",
			["article"] = "法语",
		},
		["frm"] = {
			["name"] = "中古法语",
			["article"] = "中古法语",
		},
		["frp"] = {
			["name"] = "法兰克-普罗旺斯语",
            ["article"] = "法兰克-普罗旺斯语"
		},
		["ff"] = {
			["name"] = "富拉语",
		},
		["gem-pro"] = {							-- Incorrect tag
			["name"] = "原始日耳曼语",
			["article"] = "原始日耳曼语",
			["type"] = "reconstructed",
			["replacements"] = {},
			["Wikipedia_code"] = "gem-x-proto",
		},
		["gem-x-proto"] = {
			["name"] = "原始日耳曼语",
			["article"] = "原始日耳曼语",
			["type"] = "reconstructed",
			["replacements"] = {},
		},
		["gml"] = {
			["name"] = "中世纪低地德语",
			["article"] = "中世纪低地德语",
		},
		["gmw-ecg"] = {
			["name"] = "东中部德语",
			["article"] = "东中部德语",
		},
		["gmw-x-proto"] = {
			["name"] = "原始西日耳曼语",
			["article"] = "原始西日耳曼语",
			["type"] = "reconstructed",
			["replacements"] = {},
		},
		["gmq-x-gut"] = {
			["name"] = "哥特兰语",
			["article"] = "哥特兰语",
		},
		["goh"] = {
			["replacements"] = {
				decompose = true,
				from = {
					"[" .. macron .. circumflex .. diaeresis .. "]",
				},
			},
		},
		["got"] = {
			["name"] = "哥特语",
			["article"] = "哥特语",
			["replacements"] = {
				-- Latin to Gothic since people will not want to have to copy
				-- and paste Gothic letters in
				["[AÁaáĀā]"] = "𐌰",
				["[Bb]"]     = "𐌱",
				["[Gg]"]     = "𐌲",
				["[Dd]"]     = "𐌳",
				["[EeĒē]"]   = "𐌴",
				["[Qq]"]     = "𐌵",
				["[Zz]"]     = "𐌶",
				["[Hh]"]     = "𐌷",
				["[Þþ]"]     = "𐌸",
				["[IiÍí]"]   = "𐌹",
				["[Kk]"]     = "𐌺",
				["[Ll]"]     = "𐌻",
				["[Mm]"]     = "𐌼",
				["[Nn]"]     = "𐌽",
				["[Jj]"]     = "𐌾",		
				["[UuÚúŪū]"] = "𐌿",	
				["[Pp]"]     = "𐍀",		
				["[Rr]"]     = "𐍂",	
				["[Ss]"]     = "𐍃",	
				["[Tt]"]     = "𐍄",	
				["[WwYy]"]   = "𐍅",
				["[Ff]"]     = "𐍆",
				["[Xx]"]     = "𐍇",
				["[Ƕƕ]"]    = "𐍈", -- Not sure if "hw" and "hv" can safely be converted
				["[OoŌō]"]   = "𐍉",
			},
		},
		["gsw"] = {
			["name"] = "阿勒曼尼语",
			["article"] = "阿勒曼尼语",
		},
		["grc"] = {
			["name"] = "古希腊语",
			["article"] = "古希腊语",
			["replacements"] = {
				decompose = true,
				from = {
					-- Replace variant letterforms with standard ones.
					"ϐ", "ϵ", "ϑ", "ϰ", "ϱ", "ϲ", "ϕ",
					-- Remove macrons and breves.
					"[" .. macron .. breve .. undertie .. "]"
				},
				to   = {
					"β", "ε", "θ", "κ", "ρ", "σ", "φ",
				}
			},
		},
		["grk-pro"] = {							-- Incorrect tag
			["name"] = "原始希腊语",
			["article"] = "原始希腊语",
			["type"] = "reconstructed",
			["replacements"] = {},
			["Wikipedia_code"] = "gem-x-proto",
		},
		["grk-x-proto"] = {
			["name"] = "原始希腊语",
			["article"] = "原始希腊语",
			["type"] = "reconstructed",
			["replacements"] = {},
		},
		["grt"] = {
			["name"] = "加罗语",
			["article"] = "加罗语",
		},
		["ha"] = {
			["name"] = "豪萨语",
			["article"] = "豪萨语",
			-- remove tilde, grave, acute, macron, circumflex
			["replacements"] = {
				decompose = true,
				from = { "[" .. grave .. circumflex .. macron .. acute .. tilde .. "]" },
			},
		},
		["hi"] = {
			["name"] = "印地语",
			["article"] = "印地语",
		},
		["ine-bsl-pro"] = {
			["name"] = "原始波罗的-斯拉夫语",
			["article"] = "原始波罗的-斯拉夫语",
			["type"] = "reconstructed",
		},
		["ine-pro"] = {							-- Incorrect tag
			["name"] = "原始印欧语",
			["article"] = "原始印欧语",
			["type"] = "reconstructed",
			["replacements"] = {},
			["Wikipedia_code"] = "ine-x-proto",
		},
		["ine-x-proto"] = {
			["name"] = "原始印欧语",
			["article"] = "原始印欧语",
			["type"] = "reconstructed",
			["replacements"] = {},
		},
		["ja"] = {
			["name"] = "日语",
			["article"] = "日语",
		},
		["jbo"] = { -- 逻辑语
			["type"] = "appendix",
		},
		["la"] = {
			["name"] = "拉丁语",
			["article"] = "拉丁语",
			["replacements"] = {
				decompose = true,
				from = { "[" .. macron .. breve .. diaeresis .. "]" },
			},
		},
		["lt"] = {
			["name"] = "立陶宛语",
			["article"] = "立陶宛语",
			-- remove acute, tilde, grave
			["replacements"] = {
				decompose = true,
				from = { "[" .. acute .. tilde .. grave .. "]" },
			},
		},
		["moe"] = {
			["name"] = "克里语",
			["article"] = "克里语",
		},
		["mul"] = {
			["name"] = "跨语言",
			["article"] = "跨语言",
		},
		["nci"] = {
			["name"] = "古典纳瓦特尔语",
			["article"] = "古典纳瓦特尔语",
			-- Remove macrons, acutes, circumflexes and graves
			["replacements"] = {
				decompose = true,
				-- Remove macrons, acutes, circumflexes, graves, and saltillo;
				-- see [[Saltillo (linguistics)]].
				from = { "[" .. grave .. acute .. macron .. circumflex .. "Ꞌꞌʻʼ'ʔ]" },
			},
		},
		["nds-de"] = {
			["name"] = "德国低地德语",
		},
		["odt"] = {
			["name"] = "古荷兰语",
			["article"] = "古荷兰语",
		},
		["oge"] = {
			["name"] = "古格鲁吉亚语",
			["article"] = "古格鲁吉亚语",
		},
		["oj"] = {
			["name"] = "奥吉布瓦语",
			["article"] = "奥吉布瓦语",
		},
		["orv"] = {
			["name"] = "古东斯拉夫语",
			["article"] = "古东斯拉夫语",
			["replacements"] = {
				[U(0x484)] = "",
			},
		},
		["osx"] = {
			["name"] = "古撒克逊语",
			["article"] = "古撒克逊语",
		},
		["pt"] = {
			["name"] = "葡萄牙语",
			["article"] = "葡萄牙语",
			-- ["scripts"] = { "Latn" },
		},
		["pa"] = {
			["name"] = "旁遮普语",
			["article"] = "旁遮普语",
		},
		["pis"] = {
			["name"] = "皮京语",
			["article"] = "皮京语",
		},
		["poz-x-poly-proto"] = {
			["name"] = "原始波利尼西亚语",
			["article"] = "原始波利尼西亚语",
			["type"] = "reconstructed",
		},
		["rap"] = {
			["name"] = "拉帕努伊语",
			["article"] = "拉帕努伊语",
		},
		["ru"] = {
			["name"] = "俄语",
			["article"] = "俄语",
			["replacements"] = { [acute] = "", },
		},
		["rw"] = {
			["name"] = "卢旺达-基隆迪语",
			["article"] = "卢旺达-基隆迪语",
		},
		["se"] = {
			["name"] = "北萨米语",
			["article"] = "北萨米语",
			["replacements"] = {
				["([đflmnŋrsšŧv])'%1"] = "%1%1",
			},
		},
		["sem-pro"] = {
			["name"] = "原始闪语",
			["article"] = "原始闪语",
			["type"] = "reconstructed",
		},
		["sh"] = {
			["name"] = "塞尔维亚-克罗地亚语",
			["article"] = "塞尔维亚-克罗地亚语",
			["replacements"] = {
				decompose = true,
				from =  { "([AaEeIiOoUuRrАаЕеИиОоУуРр])[" .. double_grave
					.. grave .. invbreve .. acute .. macron .. tilde .. "]" },
				to   = { "%1" },
			},
		},
		["sl"] = {
			["name"] = "斯洛文尼亚语",
			["article"] = "斯洛文尼亚语",
			["replacements"] = {
				decompose = true,
				-- remove tonal orthography
				from = {"ł", "[" .. grave .. acute .. macron .. double_grave .. invbreve .. circumflex .. dot_below .. "]"},
				to = {"l"},
			},
		},
		["sla-pro"] = {
			["name"] = "原始斯拉夫语", -- also Common Slavic
			["article"] = "原始斯拉夫语",
			["type"] = "reconstructed",
			["replacements"] = {
				["[ÀÁÃĀȀȂ]"] = "A",
				["[àáãāȁȃ]"] = "a",
				["[ÈÉẼĒȄȆ]"] = "E",
				["[èéẽēȅȇ]"] = "e",
				["[ÌÍĨĪȈȊ]"] = "I",
				["[ìíĩīȉȋ]"] = "i",
				["[ÒÓÕŌȌȎŐ]"] = "O", 
				["[òóõōȍȏő]"] = "o",
				["[ÙÚŨŪȔȖŰ]"] = "U",
				["[ùúũūȕȗű]"] = "u",
				["[ỲÝỸȲ]"] = "Y",
				["[ỳýỹȳ]"] = "y",
				["Ǭ"] = "Ǫ",
				["ǭ"] = "ǫ",
				["[" .. grave .. acute .. double_acute .. tilde .. macron .. double_grave .. invbreve .. "]"] = "",
				["ĭ"] = "ь",
				["ŭ"] = "ъ",
			},
		},
		["uk"] = {
			["article"] = "乌克兰语",
			["replacements"] = { [acute] = "", }
		},
		["ur"] = {
			["name"] = "乌尔都语",
			["article"] = "乌尔都语",
		},
		["zh"] = {
			["name"] = "汉语",
			["article"] = "汉语",
			-- ["scripts"] = { "Hani" },
		},
		["xcl"] = {
			["name"] = "古亚美尼亚语",
			["article"] = "古典亚美尼亚语",
			["replacements"] = {
				["[՞՜՛՟]"] = "",
				["և"] = "եւ",
			},
		},
		["xgf"] = {
			["name"] = "维沃特语", -- not ISO name "Gabrielino-Fernandeño"
			["article"] = "维沃特语",
			["replacements"] = {
				["['`ʔ]"] = "ʼ",
			},
		},
		["xxt"] = {
			["name"] = "坦博拉语",
			["article"] = "坦博拉语",
		},
		["xvn"] = {
			["name"] = "汪达尔语",
			["article"] = "汪达尔语",
		},
		["yua"] = {
			["name"] = "尤卡坦玛雅语",
			["article"] = "尤卡坦玛雅语",
		},
	},

-- Here, keys (for example, "gem") are Wikipedia language codes used in
-- {{lang}}, and values (for example, "gem-pro") are the equivalent Wiktionary
-- code.
-- Subtags are not currently supported.
	["redirects"] = {
		["aae"] = "sq",
		["aiq"] = "fa",
		["aln"] = "sq",
		["als"] = "sq",
		["azb"] = "az",
		["azj"] = "az",
		["bgn"] = "bal",
		["bs"] = "sh",
		["bxr"] = "bua",
		["ciw"] = "oj",
		["cnr"] = "sh",
		["fil"] = "tl",
		["fuf"] = "ff",
		["gem"] = "gem-pro", -- Not correct, but is commonly used.
		["hak"] = "zh",
		["hbo"] = "he",
		["hr"] = "sh",
		["ine"] = "ine-pro", -- Not correct, but might be commonly used.
		["kjv"] = "sh",
		["nan"] = "zh",
		["prs"] = "fa",
		["rn"] = "rw",
		["sli"] = "gmw-ecg",
		["sr"] = "sh",
		["src"] = "sc",
		["sro"] = "sc",
		["tw"] = "ak",
		["wae"] = "gsw",
		["wep"] = "nds-de",
		["yue"] = "zh",
		["xno"] = "fro",
	},
}

return data