Jump to content

Module:Efn native lang

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Geographyinitiative (talk | contribs) at 00:34, 22 November 2019 (Undid revision 927359728 by Ythlev (talk) I like your recent edits and have very minor objections. I think that this edit I am making is an informative edit for the readers; if I have to discuss all my useful edits beforehand we would become Baidu Baike. If you have any specific objections let me know what they are and I will try to accomodate.). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

local getArgs = require("Module:Arguments").getArgs
local lang = require("Module:Lang").lang
local p = {}

function p.main(frame)
	local args = getArgs(frame)
	local function nowrap(tag, s) -- Disables wrapping for words under four characters
		if string.len(s) < 12 then
			return table.concat{"<span class=\"nowrap\">", lang{tag, s}, "</span>"}
		else
			return lang{tag, s}
		end
	end
	return args[1] == "tw" and frame:expandTemplate{
		title = "Efn-ur",
		args = {
			name = args.name,
			require("Module:List").bulleted{
				args.t and "[[Chinese characters|Chinese script]]: " .. nowrap("zh-Hant-TW", args.t),
				args.p and "[[Taiwanese Mandarin|Mandarin]] [[Pinyin]]: " .. lang{"cmn-Latn-TW", args.p},
				args.m and "[[Taiwanese Hokkien|Minnan]] [[Official romanisation scheme for Taiwanese Hokkien|romanization]]: " .. lang{"nan-Latn-TW", args.m},
				args.s and "[[Sixian dialect|Sixian]] [[Taiwanese Hakka|Hakka]]: " .. lang{"hak-Latn-TW", args.s},
				args.h and "[[Hailu dialect|Hailu]] [[Taiwanese Hakka|Hakka]]: " .. lang{"hak-Latn-TW", args.h},
				args.a and "[[Amis language|Amis]]: " .. lang{"ami-Latn-TW", args.a},
				args.pw and "[[Paiwan language|Paiwan]]: " .. lang{"pwn-Latn-TW", args.pw},
				args.ma and "[[Matsu dialect|Matsu]]: " .. lang{"cdo-Latn-TW", args.ma},
			}
		}
	}
end

return p