Lompat ke isi

Modul:Infobox multi-lingual name/data

Dari Wikipedia bahasa Indonesia, ensiklopedia bebas

--[[--------------------------< L A B E L _ M A P >------------------------------------------------------------

Table to map |showflags= value to the |labeln= parameter value for {{Infobox}}

TODO: convert showflag to a comma delimited list instead of these peculiar codes?

]]
 
local label_map = {
	['bp'] = '[[Bbánlám pìngyīm|Bbánlám Pìngyīm]]',
	['bpmf'] = '[[Bopomofo]]',
	['gan'] = '[[Bahasa Gan|Gan]]',
	['gd'] = '[[Romanisasi Guangdong]]',
	['h'] = '[[Romanisasi Guangdong#Hakka|Hakka]]',
	['hsn'] = '[[Bahasa Xiang|Xiang]]',
	['j'] = '[[Jyutping]]',
	['lmz'] = '[[dialek Shanghai]]<br />[[Long-short (romanisasi)|Romanisasi]]',
	['p'] = '[[Hanyu Pinyin]]',
	['phfs'] = '[[Pha̍k-fa-sṳ]]',
	['poj'] = '[[Bahasa Hokkien|Hokkien]] [[Pe̍h-ōe-jī|POJ]]',
	['psic'] = '[[dialek Sichuan|Sichuan]] [[Sichuan Pinyin|Pinyin]]',
	['tl'] = '[[Sistem Romanisasi Bahasa Min Nan Taiwan|Tâi-lô]]',
	['toi'] = '[[Bahasa Taishan|Taishan]]',
	['tp'] = '[[Tongyong Pinyin]]',
	['w'] = '[[Wade–Giles]]',
	['wuu'] = '[[Rumpun bahasa Wu|Wu]]',
	['xej'] = '[[Xiao\'erjing]]',
	['y'] = '[[Bahasa Kanton]] [[Romanisasi Yale bahasa Kanton|Yale]]',
	}


--[[--------------------------< T R A N S L _ M A P >----------------------------------------------------------

Table to map |showflags= value to an index into label_map for child infobox |labeln= value and to map |showflags=
vale to the correct parameter for use in child infobox |datan= paramter

Implementation deatils of |showflag= are in dispute see: Template_talk:Infobox_Chinese#Rfc_on_fixing_the_template_showflag

linked conversation is at: Template_talk:Infobox_Chinese/Archive_4#Showflag broken

]]

local transl_map = {															-- maps |showflag= value to label from label_map table and data from matching parameter name
	['bp'] = {['label1'] = 'bp', ['data1'] = 'bp'},
	['bpmf'] = {['label1'] = 'bpmf', ['data1'] = 'bpmf'},
	['gan'] = {['label1'] = 'gan', ['data1'] = 'gan'},
	['gdp'] = {['label1'] = 'gd', ['data1'] = 'gd', ['label2'] = 'p', ['data2'] = 'p'},
	['h'] = {['label1'] = 'h', ['data1'] = 'h'},
	['hsn'] = {['label1'] = 'hsn', ['data1'] = 'hsn'},
	['j'] = {['label1'] = 'j', ['data1'] = 'j'},
	['jp'] = {['label1'] = 'j', ['data1'] = 'j', ['label2'] = 'p', ['data2'] = 'p'},
	['jy'] = {['label1'] = 'j', ['data1'] = 'j', ['label2'] = 'y', ['data2'] = 'y'},
	['jyp'] = {['label1'] = 'j', ['data1'] = 'j', ['label2'] = 'y', ['data2'] = 'y', ['label3'] = 'p', ['data3'] = 'p'},
	['lmz'] = {['label1'] = 'lmz', ['data1'] = 'lmz'},
	['p'] = {['label1'] = 'p', ['data1'] = 'p'},
	['phfs'] = {['label1'] = 'phfs', ['data1'] = 'phfs'},
	['phsn'] = {['label1'] = 'p', ['data1'] = 'p', ['label2'] = 'hsn', ['data2'] = 'hsn'},
	['pj'] = {['label1'] = 'p', ['data1'] = 'p', ['label2'] = 'j', ['data2'] = 'j'},
	['poj'] = {['label1'] = 'poj', ['data1'] = 'poj'},
	['psic'] = {['label1'] = 'p', ['data1'] = 'p', ['label2'] = 'sic', ['data2'] = 'sic'},
	['pwuu'] = {['label1'] = 'p', ['data1'] = 'p', ['label2'] = 'wuu', ['data2'] = 'wuu'},
	['py'] = {['label1'] = 'p', ['data1'] = 'p', ['label2'] = 'y', ['data2'] = 'y'},
	['tl'] = {['label1'] = 'tl', ['data1'] = 'tl'},
	['toip'] = {['label1'] = 'toi', ['data1'] = 'toi', ['label2'] = 'p', ['data2'] = 'p'},
	['tp'] = {['label1'] = 'tp', ['data1'] = 'tp'},
	['wp'] = {['label1'] = 'w', ['data1'] = 'w', ['label2'] = 'p', ['data2'] = 'p'},
	['wuu'] = {['label1'] = 'wuu', ['data1'] = 'wuu'},
	['y'] = {['label1'] = 'y', ['data1'] = 'y'},
	['yj'] = {['label1'] = 'y', ['data1'] = 'y', ['label2'] = 'j', ['data2'] = 'j'},
	['xej'] = {
		['label1'] = 'xej',
		['data1'] = 'xej',				-- ???? what to do about this; template calls {{lang|zh-Arab|{{{xej}}}}} on this value
		},
	['xejp'] = {
		['label1'] = 'xej',
		['data1'] = 'xej',				-- ???? template does not call {{lang|zh-Arab|{{{xej}}}}} on this value; why?
		['label2'] = 'p',
		['data2'] = 'p'
		},
	}


--[[--------------------------< K E Y S >----------------------------------------------------------------------
]]

local keys = {																	-- table of xscript table keys calls
	ar = 'arabic',
	bo = 'tibetan',
	poj = 'hokkien',
	ja = 'japanese',
	ko = 'korean',
	mn = 'mongolian',
	ru = 'russian',
	ug = 'uyghur',
	}


--[[--------------------------< X S C R I P T >----------------------------------------------------------------

table that holds the various transcription headers and labels used by transcriptions()

indexed in this table are lower case versions of the header display text without punctuation (if any)

TODO: add support for transl transliteration standard parameter; akin to {{transl|lang code|standard code|text|italic=??}}

]]

local xscript = {
	['standard mandarin'] = {													-- lower case version of the header display text
		['header'] = '[[Standard Chinese|Standard Mandarin]]',					-- text to be displayed if headers are displayed
		['t'] = {																-- table of labels and their associated data parameter
			{'[[Hanyu Pinyin]]', 'p'},											-- label is [[Hanyu Pinyin]], data is taken from |p= parameter
			{'[[Bopomofo]]','bpmf'},
			{'[[Ejaan dalam Gwoyeu Romatzyh|Gwoyeu Romatzyh]]', 'gr'},
			{'[[Wade–Giles]]', 'w'},
			{'[[Tongyong Pinyin]]', 'tp'},
			{'[[Romanisasi Yale Mandarin|Romanisasi Yale]]', 'myr'},
			{'[[Mandarin Phonetic Symbols II|MPS2]]', 'mps'},
			{'[[Help:IPA/Mandarin|IPA]]', 'mi'}
			}
		},
	['other mandarin'] = {
		['header'] = '[[Mandarin Chinese|other Mandarin]]',
		['t'] = {
			{'[[Xiao\'erjing]]', 'xej'},
			{'[[Bahasa Dungan|Dungan]]','zh-dungan'},
			{'[[dialek Sichuan|Sichuan]] [[Sichuan Pinyin|Pinyin]]', 'sic'},
			}
		},
	['wu'] = {
		['header'] = '[[Rumpun bahasa Wu|Wu]]',
		['t'] = {
			{'[[Romanisasi Rumpun bahasa Wu|Romanisasi]]', 'wuu'},
			{'[[dialek Shanghai]]<br />Romanisasi', 'lmz'},
			{'[[Bahasa Wenzhou|Wenzhou]]<br />[[Romanisasi bahasa Wenzhou|Romanisasi]]', 'ouji'},
			{'[[Bahasa Suzhou|Suzhou]]', 'suz'},
			}
		},
	['gan'] = {
		['header'] = '[[Bahasa Gan|Gan]]',
		['t'] = {
			{'Romanisasi', 'gan'},
			}
		},
	['xiang'] = {
		['header'] = '[[Bahasa Xiang|Xiang]]',
		['t'] = {
			{'IPA', 'hsn'},
			}
		},
	['hakka'] = {
		['header'] = '[[Hakka Chinese|Hakka]]',
		['t'] = {
			{'[[Romanisasi Guangdong#Hakka|Romanisasi]]', 'h'},
			{'[[Pha̍k-fa-sṳ]]', 'phfs'},
			}
		},
	['yue Bahasa Kanton'] = {
		['header'] = '[[Bahasa Kanton|Yue: Bahasa Kanton]]',
		['t'] = {
			{'[[Romanisasi Yale bahasa Kanton|Romanisasi Yale]]', 'y'},
			{'[[Jyutping]]', 'j'},
			{'[[Romanisasi Sidney Lau|Sidney Lau]]', 'sl'},
			{'[[Romanisasi Guangdong|Romanisasi Kanton]]', 'gd'},
			{'[[Romanisasi Kanton Pemerintah Hong Kong|Romanisasi Hong Kong]]', 'hk'},
			{'[[Bahasa Kanton#Romanisasi|Romanisasi Makau]]', 'mo'},
			{'[[Help:IPA/Bahasa Kanton|IPA]]', 'ci'},
			}
		},
	['other yue'] = {
		['header'] = '[[Yue Chinese|other Yue]]',
		['t'] = {
			{'[[Bahasa Taishan|Taishan]]', 'toi'},
			}
		},
	['southern min'] = {
		['header'] = '[[Southern Min]]',
		['t'] = {
			{'[[Bahasa Hokkien|Hokkien]] [[Pe̍h-ōe-jī|POJ]]', 'poj'},
			{'[[Sistem Romanisasi Bahasa Min Nan Taiwan|Tâi-lô]]', 'tl'},
			{'[[Bbánlám pìngyīm|Bbánlám Pìngyīm]]', 'bp'},
			{'[[Dialek Teochew|Teochew]] [[Romanisasi Guangdong#Teochew|Peng\'im]]', 'teo'},
			{'Romanisasi [[bahasa Hainan]]', 'hain'},
			{'Romanisasi [[Leizhou Min|Leizhou]]', 'lizu'},
			}
		},
	['eastern min'] = {
		['header'] = '[[Bahasa Min Timur]]',
		['t'] = {
			{'[[Dialek Fuzhou|Fuzhou]] [[Romanisasi Foochow|BUC]]', 'buc'},
			}
		},
	['pu-xian min'] = {
		['header'] = '[[Pu-Xian Min]]',
		['t'] = {
			{'[[Pu-Xian Min|Hinghwa]] [[Romanisasi Hinghwa|BUC]]', 'hhbuc'},
			}
		},
	['northern min'] = {
		['header'] = '[[Northern Min]]',
		['t'] = {
			{'[[Dialek Jian\'ou|Jian\'ou]] [[Romanisasi Sehari-hari Kienning|Romanisasi]]', 'mblmc'},
			}
		},
	['old mandarin'] = {
		['header'] = '[[bahasa Mandarin Kuno|Mandarin Kuno]]',
		['t'] = {
			{'Romanisasi \'Phags-pa', 'phagspa-latin'},
			}
		},
	['middle chinese'] = {
		['header'] = '[[Bahasa Tionghoa Pertengahan|Tionghoa Pertengahan]]',
		['t'] = {
			{'[[Bahasa Tionghoa Pertengahan|Tionghoa Pertengahan]]', 'mc'},
			{'[[Bahasa Tionghoa Pertengahan#Tionghoa Pertengahan Awal|Tionghoa Pertengahan Awal]]', 'emc'},
			{'[[Bahasa Tionghoa Pertengahan#Tionghoa Pertengahan Akhir|Tionghoa Pertengahan Akhir]]', 'lmc'},
			}
		},
	['old chinese'] = {
		['header'] = '[[bahasa Mandarin Kuno|Mandarin Kuno]]',
		['t'] = {
			{'[[Rekonstruksi_bahasa_Tionghoa_Kuno#Baxter (1992)|Baxter (1992)]]', 'oc-b92'},
			{'[[Rekonstruksi_bahasa_Tionghoa_Kuno#Baxter–Sagart (2014)|Baxter–Sagart (2014)]]', 'oc-bs'},
			{'[[Rekonstruksi_bahasa_Tionghoa_Kuno#Zhengzhang (1981–1995)|Zhengzhang]]', 'oc-zz'},
			}
		},

--------< non-Chinese transcriptions >--------

	['arabic'] = {
		['header'] = nil,														-- {{Infobox Chinese/Arabic}}; doesn't use header
		['t'] = {
			{'[[Alfabet chat Arab|Chat]]', 'chat'},							-- TODO: standardize on lowercase parameter names
			{'[[Alfabet chat Arab|Chat]]', 'Chat'},
			{'[[Romanisasi ALA-LC|ALA-LC]]', 'ala-lc'},
			{'[[Romanisasi ALA-LC|ALA-LC]]', 'ALA-LC'},
			{'[[ISO 233|ISO]]', 'iso'},
			{'[[ISO 233|ISO]]', 'ISO'},
			{'[[DIN 31635|DIN]]', 'din'},
			{'[[DIN 31635|DIN]]', 'DIN'},
			}
		},
	['hokkien'] = {
		['header'] = nil,														-- {{Infobox Chinese/Bahasa Hokkien}}; doesn't use header
		['t'] = {
			{'[[Sistem Romanisasi Bahasa Min Nan Taiwan|Tâi-lô]]', 'tl'},
			{'[[Bbánlám pìngyīm|Bbánpìng]]', 'bp'},
			{'[[Bantuan:IPA/Bahasa Hokkien|IPA]]', 'hokkienipa'},
			}
		},
	['japanese'] = {
		['header'] = nil,														-- {{Infobox Chinese/Japanese}}; doesn't use header
		['t'] = {
			{'[[Romaji]]', 'romaji'},
			{'[[Alih aksara Hepburn|Hepburn disempurnakan]]', 'revhep'},
			{'[[Alih aksara Hepburn|Hepburn tradisional]]', 'tradhep'},
			{'[[Romanisasi Kunrei-shiki|Kunrei-shiki]]', 'kunrei'},
			{'[[Romanisasi Nihon-shiki|Nihon-shiki]]', 'nihon'},
			}
		},
	['korean'] = {
		['header'] = nil,														-- {{Infobox Chinese/Korean}}; doesn't use header
		['t'] = {
			{'[[Alih Aksara Korea yang Disempurnakan|Romanisasi disempurnakan]]', 'rr'},
			{'[[McCune–Reischauer]]', 'mr'},
			{'[[Help:IPA/Bahasa Korea|IPA]]', 'koreanipa'},
			}
		},
	['mongolian'] = {
		['header'] = nil,														-- {{Infobox Chinese/Mongolian}}; doesn't use header
		['t'] = {
			{'[[SASM/GNC romanization#Mongolian|SASM/GNC]]', 'monr'},
			}
		},
	['russian'] = {
		['header'] = nil,														-- {{Infobox Chinese/Russian}}; doesn't use header
		['t'] = {
			{'[[Transliterasi ilmiah dari Kirilik|Transliterasi ilmiah]]', 'scientific'},
			{'[[Transliterasi ilmiah dari Kirilik|Transliterasi ilmiah]]', 'Ilmiah'},
			{'[[ISO 9|ISO]]', 'iso'},
			{'[[ISO 9|ISO]]', 'ISO'},
			{'[[GOST 16876-71|GOST 71]]', 'gost'},
			{'[[GOST 16876-71|GOST 71]]', 'GOST'},
			{'[[BGN/PCGN romanization of Russian|BGN/PCGN]]', 'bgn/pcgn'},
			{'[[BGN/PCGN romanization of Russian|BGN/PCGN]]', 'BGN/PGCN'},
			}
		},
	['tibetan'] = {
		['header'] = nil,														-- {{Infobox Chinese/Tibetan}}; doesn't use header
		['t'] = {
			{'[[Transliterasi Wylie|Wylie]]', 'wylie'},
			{'[[Transkripsi Fonetik Sederhana THL|THL]]', 'thdl'},
			{'[[Pinyin Tibet]]', 'zwpy'},
			{'[[Bahasa Tibet Lhasa|Lhasa]] [[Help:IPA/Bahasa Tibet|IPA]]', 'lhasa'},
			}
		},
	['uyghur'] = {
		['header'] = nil,														-- {{Infobox Chinese/Uyghur}}; doesn't use header
		['t'] = {
			{'[[Alfabet Uighur Latin|Latin Yëziqi]]', 'uly'},
			{'[[Aksara Baru Uyghur|Yengi Yeziⱪ]]', 'uyy'},
			{'[[Romanisasi SASM/GNC#Uyghur|SASM/GNC]]', 'sgs'},
			{'[[Alfabet Uighur Kirilik|Siril Yëziqi]]', 'usy'},
			{'[[Wikipedia:IPA|IPA]] Uighur', 'uipa'},
			}
		},
	}


--[[--------------------------< I B O X _ Z H Z H _ E N U M _ P A R A M S >------------------------------------
]]

local ibox_zhzh_enum_params = {													-- 'p', 'hp', 'xej' are special case enum parameters
	'c', 't', 's', 'l', 'tp', 'w', 'mi', 'myr', 'psp', 'myale', 'gr', 'bpmf', 'mps',
	'zh-dungan', 'sic', 'y', 'j', 'sl', 'gd', 'hk', 'mo', 'ci', 'toi', 'gan', 'wuu', 'ouji', 'suz',
	'hsn', 'h', 'phfs', 'poj', 'tl', 'bp', 'buc', 'hhbuc', 'mblmc', 'lmz', 'teo', 'lizu', 'hain',
	'mc', 'emc', 'lmc', 'oc-bs', 'oc-zz',
	'oc-b92', 																	-- only supported in the first ibox zhzh; why?
	'lao', 'khm', 'tet'															-- not supported by ibox zh/zh  why are they here?
	}


--[[--------------------------< Z H _ H D R _ N A M E S >------------------------------------------------------

this table fixes an oddity in the ibox zh/zh header name parameters.  |chinese_header= for the first ibox zh/zh 
gets filled from |name1= but the second gets its name from |altname= and then the third from |altname3=.
All of these parameter names should be replaced with |chinese_header= followed by |chinese_header2= ... like all
of the other enumerated parameters

]]

local zh_hdr_names = {
	[2] = {'altname', 'Nama alternatif Tiongkok'},
	[3] = {'altname3', 'Nama arternatif Tiongkok kedua'},
	[4] = {'altname4', 'Nama arternatif Tiongkok ketiga'},
	[5] = {'altname5', 'Nama arternatif Tiongkok keempat'},
	[6] = {'altname6', 'Nama arternatif Tiongkok kelima'},
	};


--[[--------------------------< E X P O R T E D   T A B L E S >------------------------------------------------
]]

return {
	ibox_zhzh_enum_params = ibox_zhzh_enum_params,
	keys = keys,
	label_map = label_map,
	transl_map = transl_map,
	xscript = xscript,
	zh_hdr_names = zh_hdr_names,
	}