Module:User:ZxxZxxZ/Cyrl-translit

Hello, you have come here looking for the meaning of the word Module:User:ZxxZxxZ/Cyrl-translit. In DICTIOUS you will not only get to know all the dictionary meanings for the word Module:User:ZxxZxxZ/Cyrl-translit, but we will also tell you about its etymology, its characteristics and you will know how to say Module:User:ZxxZxxZ/Cyrl-translit in singular and plural. Everything you need to know about the word Module:User:ZxxZxxZ/Cyrl-translit you have here. The definition of the word Module:User:ZxxZxxZ/Cyrl-translit will help you to be more precise and correct when speaking or writing your texts. Knowing the definition ofModule:User:ZxxZxxZ/Cyrl-translit, as well as those of other words, enriches your vocabulary and provides you with more and better linguistic resources.

Language code in page name (User:ZxxZxxZ/Cyrl) not recognized.


--[[
Transliteration for the Cyrillic.
]]

local export = {}
 
local tr_table_default = {
    ="a",  ="b",  ="v",  ="g",  ="ğ",  ="d",  ="ž",  ="ẑ",
    ="i",  ="i",  ="ji", ="j",  ="j",  ="k",  ="kj", ="q",
    ="l",  ="lj", ="n",  ="nj", ="o",  ="p",  ="r",  ="s",
    ="t",  ="ć",  ="u",  ="w",  ="c",  ="č",  ="dž", ="ç",
    ="š",  ="šč", ="f",  ="x",  ="dž", ="š",  ="šč", ="f",
    ="m",  ="đ",  ="e",  ="jo", ="ju", ="ja", ="e",  ="je",
    -- ... this table should contain all Cyrillic characters
    }

-- this table overrides the previous one
local tr_table = {
     = {
        ="ā", ="γ", ="e", ="ë", ="j", ="w",
        ="š̍", ="”", ="ə", ="’", ="ă", ="jā"
        },
     = {
        ='h', ='g', ='E', ='e', ='Je', ='je', 
        ='y', ='ʺ', ='ʺ', = 'ʺ',
        },
    -- ...
    }

function export.tr(text, lang)
    if type(text) == 'table' then text = text.args end

    if lang ~= "ady" and lang ~= "uk" then
        -- not supported
        return false
    end

-- language-specific transliteration --

    if lang == "ady" then
        text = mw.ustring.gsub(text, 'гъу', 'ġ°')
        text = mw.ustring.gsub(text, 'дзу', 'ʒ°')
        text = mw.ustring.gsub(text, 'жъу', 'ẑ°')
        -- and so forth
    end

    text = mw.ustring.gsub(text, ".", tr_table)

-- default Cyrillic transliteration --

    text = mw.ustring.gsub(text, ".", tr_table_default)
    text = mw.ustring.toNFD(text)
    text = mw.ustring.gsub(text, ".", tr_table_default)
    text = mw.ustring.toNFC(text)

    text = mw.ustring.gsub(text, "(?)е", "%1je")
    text = mw.ustring.gsub(text, "^Е", "Je")
    text = mw.ustring.gsub(text, "^е", "je")

    return text
end

return export