Open main menu
Home
Random
Donate
Recent changes
Special pages
Community portal
Preferences
About Stockhub
Disclaimers
Search
User menu
Talk
Contributions
Create account
Log in
Editing
Module:Lang-hbs
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
local p = {} -- Cyrillic to Latin substitution table local c2l = { ["а"] = "a", ["А"] = "A", ["б"] = "b", ["Б"] = "B", ["в"] = "v", ["В"] = "V", ["г"] = "g", ["Г"] = "G", ["д"] = "d", ["Д"] = "D", ["ђ"] = "đ", ["Ђ"] = "Đ", ["е"] = "e", ["E"] = "E", ["ж"] = "ž", ["Ж"] = "Ž", ["з"] = "z", ["З"] = "Z", ["и"] = "i", ["И"] = "I", ["ј"] = "j", ["Ј"] = "J", ["к"] = "k", ["К"] = "K", ["л"] = "l", ["Л"] = "L", ["љ"] = "lj", ["Љ"] = "Lj", ["м"] = "m", ["М"] = "M", ["н"] = "n", ["Н"] = "N", ["њ"] = "nj", ["Њ"] = "Nj", ["о"] = "o", ["О"] = "O", ["п"] = "p", ["П"] = "P", ["р"] = "r", ["Р"] = "R", ["с"] = "s", ["С"] = "S", ["т"] = "t", ["Т"] = "T", ["ћ"] = "ć", ["Ћ"] = "Ć", ["у"] = "u", ["У"] = "U", ["ф"] = "f", ["Ф"] = "F", ["х"] = "h", ["Х"] = "H", ["ц"] = "c", ["Ц"] = "C", ["ч"] = "č", ["Ч"] = "Č", ["џ"] = "dž", ["Џ"] = "Dž", ["ш"] = "š", ["Ш"] = "Š" } -- Latin to Cyrillic substitution table local l2c = { ["a"] = "а", ["A"] = "А", ["b"] = "б", ["B"] = "Б", ["v"] = "в", ["V"] = "В", ["g"] = "г", ["G"] = "Г", ["d"] = "д", ["D"] = "Д", ["đ"] = "ђ", ["Đ"] = "Ђ", ["e"] = "е", ["E"] = "E", ["ž"] = "ж", ["Ž"] = "Ж", ["z"] = "з", ["Z"] = "З", ["i"] = "и", ["I"] = "И", ["j"] = "ј", ["J"] = "Ј", ["k"] = "к", ["K"] = "К", ["l"] = "л", ["L"] = "Л", ["lj"] = "љ", ["Lj"] = "Љ", ["LJ"] = "Љ", ["m"] = "м", ["M"] = "М", ["n"] = "н", ["N"] = "Н", ["nj"] = "њ", ["Nj"] = "Њ", ["NJ"] = "Њ", ["o"] = "о", ["O"] = "О", ["p"] = "п", ["P"] = "П", ["r"] = "р", ["R"] = "Р", ["s"] = "с", ["S"] = "С", ["t"] = "т", ["T"] = "Т", ["ć"] = "ћ", ["Ć"] = "Ћ", ["u"] = "у", ["U"] = "У", ["f"] = "ф", ["F"] = "Ф", ["h"] = "х", ["H"] = "Х", ["c"] = "ц", ["C"] = "Ц", ["č"] = "ч", ["Č"] = "Ч", ["dž"] = "џ", ["Dž"] = "Џ", ["DŽ"] = "Џ", ["š"] = "ш", ["Š"] = "Ш" } function _cyr2lat(str) local lat = mw.ustring.gsub(str, "%a", c2l) return lat end function _lat2cyr(str) local cyr = mw.ustring.gsub(str, "%a", l2c) return cyr end function p.cyr2lat(frame) return _cyr2lat(frame.args[1]) end function p.lat2cyr(frame) return _lat2cyr(frame.args[1]) end function p.convert(frame) local lat = frame.args.latin local cyr = frame.args.cyrillic if not cyr then if lat then cyr = _lat2cyr(lat) else error("Neither Latin nor Cyrillic text is included", 0) end elseif not lat then lat = _cyr2lat(cyr) end return mw.ustring.format("\'\'%s\'\', %s", lat, cyr) end return p
Summary:
Please note that all contributions to Stockhub may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Stockhub:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Templates used on this page:
Template:Module other
(
edit
)
Template:Module rating
(
edit
)
Template:Ombox
(
edit
)
Template:Para
(
edit
)
Module:Arguments
(
edit
)
Module:Lang-hbs/doc
(
edit
)
Module:Message box
(
edit
)
Module:Message box/configuration
(
edit
)
Module:Message box/ombox.css
(
edit
)
Module:Yesno
(
edit
)