Module:Lang: Difference between revisions

Content deleted Content added
support for |raw=yes in _name_from_tag();
whitelist some non-Latn-script transliteration characters;
Line 1,054:
 
local function is_latin (text, script, transl)
-- if mw.ustring.find (text, 'θ', 1, true) then -- does <text> contain 'θ'?
local whitelist = '[ʻʼʾʿΔαβγδθφχϑьᾱῑ῾上入去平]'
text = text:gsub ('θ', ''); -- remove theta from <text>
if mw.ustring.find (text, whitelist) then -- does <text> contain characters from the whitelist?
-- text = text:gsub ('θ', ''); -- remove theta from <text>
text = mw.ustring.gsub (text, whitelist, ''); -- remove whitelisted characters from <text>
if 0 == text:len() then -- will be zero if theta was the only character in <text>
if transl then -- not nil for {{transliteration}}; assume Latin theta because this is 'transliteration' template