Modulo:tradukuri: Diferi inter la revizi

Kontenajo efacita Kontenajo adjuntita
Algentem (diskutez | kontributadi)
Pagino kreesis kun 'local m_links = require("Module:ligili") local export = {} local interwiki_langs = { ["nds-de"] = "nds", ["nds-nl"] = "nds", ["pdt"] = "nds", } local ignore_caps = { [...'
 
Nula rezumo di redakto
Lineo 1:
local m_links = require("Module:ligili")
 
local export = {}
 
function export.show(frame)
local interwiki_langs = {
local test = frame.args[1] or ""
["nds-de"] = "nds",
["nds-nl"] = "nds",
["pdt"] = "nds",
}
 
sections = {}
local ignore_caps = {
sections[1] = {"Fonto", {"en", "fr", "de", "es", "it", "ru"}}
["ko"] = true,
sections[2] = {"A-lingui", {"af", "sq", "ar", "an", "hy", "ast", "ay", "az"}}
}
sections[3] = {"B-lingui", {"eu", "be", "bs", "br", "bg"}}
sections[4] = {"C-lingui", {"ce", "cs", "zh", "cv"}}
sections[5] = {"D-lingui", {"da"}}
sections[6] = {"E-lingui", {"myv", "eo", "et"}}
sections[7] = {"F-lingui", {"fi", "fy"}}
sections[8] = {"G-lingui", {"gl", "ka", "el"}}
sections[9] = {"H-lingui", {"haw", "he", "hi", "hu"}}
sections[10] = {"I-lingui", {"id", "ia", "ie", "ga", "is"}}
sections[11] = {"J-lingui", {"ja"}}
sections[12] = {"K-lingui", {"ca", "kv", "ko", "co", "hr", "ku"}}
sections[13] = {"L-lingui", {"se", "la", "lv", "lt", "jbo", "lb"}}
sections[14] = {"M-lingui", {"mk", "mg", "ms", "mhr", "mdf", "mn"}}
sections[15] = {"N-lingui", {"nl", "no", "nn", "nov"}}
sections[16] = {"O-lingui", {"oc", "om"}}
sections[17] = {"P-lingui", {"fa", "pms", "pl", "pt"}}
sections[18] = {"Q-lingui", {"qu"}}
sections[19] = {"R-lingui", {"ro"}}
sections[20] = {"S-lingui", {"sr", "scn", "sco", "sk", "sl", "so", "nso", "sv", "sw"}}
sections[21] = {"T-lingui", {"tl", "th", "tt", "tok", "tr"}}
sections[22] = {"U-lingui", {"udm", "uk"}}
sections[23] = {"V-lingui", {"vi", "vo"}}
sections[24] = {"W-lingui", {"cy", "war"}}
sections[25] = {"X-lingui", {"xh"}}
sections[26] = {"Y-lingui", {"yi", "yo"}}
sections[27] = {"Z-lingui", {"zu"}}
 
return "test"
-- The main entry point.
-- This is the only function that can be invoked from a template.
function export.show(frame)
local params = {
[1] = {required = true, default = "und"},
[2] = {},
[3] = {list = true},
["alt"] = {},
["sc"] = {},
["tr"] = {},
["lit"] = {},
}
local args = require("Module:parametri").process(frame:getParent().args, params)
local terminfo = {
lang = require("Module:lingui").getByCode(args[1]) or error("The language code \"" .. args[1] .. "\" is not valid."),
sc = (args["sc"] and (require("Module:skripti").getByCode(args["sc"]) or error("The script code \"" .. args["sc"] .. "\" is not valid.")) or nil),
term = args[2] or (mw.title.getCurrentTitle().nsText == "Template" and "term") or nil,
alt = args["alt"],
genders = args[3],
tr = args["tr"],
lit = args["lit"],
interwiki = frame.args["interwiki"],
}
-- Translations must be for mainspace languages
if terminfo.lang:getType() == "reconstructed" or terminfo.lang:getType() == "appendix-constructed" then
error("Translations must be for attested and approved main-namespace languages.")
end
-- Don't show the interwiki link if there is nothing to link to.
if terminfo.term then
local wmlangs = {}
if interwiki_langs[terminfo.lang:getCode()] then
wmlangs = {require("Module:lingui di wikimedia").getByCode(interwiki_langs[terminfo.lang:getCode()])}
else
wmlangs = terminfo.lang:getWikimediaLanguages()
end
-- Don't show the interwiki link if the language is not recognised by Wikimedia
-- or if the term contains links (for SOP translations)
if terminfo.term:find("[[", nil, true) or #wmlangs == 0 then
terminfo.interwiki = false
end
if wmlangs[1] and ignore_caps[wmlangs[1]:getCode()] then
terminfo.term2 = mw.ustring.gsub(terminfo.term, "^%^", "")
end
if terminfo.interwiki then
terminfo.interwiki =
"<span class=\"" .. terminfo.interwiki .. "\">&nbsp;[[:" ..
wmlangs[1]:getCode() .. ":" ..
terminfo.lang:makeEntryName(terminfo.term2 or terminfo.term) ..
"|(" .. wmlangs[1]:getCode() .. ")]]</span>"
end
end
if terminfo.lang and terminfo.lang:getCode() == 'yue' and terminfo.tr then
terminfo.tr = mw.ustring.gsub(terminfo.tr, '([1-9])','<sup>%1</sup>')
terminfo.tr = mw.ustring.gsub(terminfo.tr, '[-*]','⁻')
end
return m_links.full_link(terminfo, nil, true)
end