Modul:etymology/templates/internal: Perbezaan antara semakan
Kandungan dihapus Kandungan ditambah
PeaceSeekers (bincang | sumb.) Tiada ringkasan suntingan |
Mengemas kini fungsi modul seperti di Wikikamus bahasa Inggeris Teg: Dibalikkan |
||
Baris 1:
-- For internal use only with [[Module:etymology/templates]] and its submodules.
local process_params = require("Module:parameters").process
local export = {}
Baris 6 ⟶ 7:
return require("Module:languages").getByCode(lang, param)
end
function export.fetch_source(code, param, disallow_family)
return require("Module:languages").getByCode(code, param, true, not disallow_family)
end
function export.fetch_script(sc, param)
Baris 39 ⟶ 16:
end
do
local function
local boolean = {type = "boolean"}
[1] = {
required = true,
},
[
required = true,
family = not no_family,
default = "und"
},
[
[
[5] = alias_of_t,
["alt"] = plain,
["gloss"] = alias_of_t,
["id"] = plain,
["lit"] = plain,
["pos"] = plain,
["t"] = plain,
["tr"] = plain,
["ts"] = plain,
["sc"] = {type = "script"},
["senseid"] = plain,
["nocat"] = boolean,
["sort"] = plain,
["conj"] = plain,
}
if has_text then
params["notext"] = boolean
params["nocap"] = boolean
end
return process_params(frame:getParent().args, params)
end
function export.parse_2_lang_args(frame, has_text, no_family)
local sources = args[2]
return args, args[1], {
lang = sources[#sources],
sc = args["sc"],
id = args["id"],
genders = args["g"],
tr = args["tr"],
ts = args["ts"],
gloss = args["t"],
pos = args["pos"],
lit = args["lit"]
}, #sources > 1 and sources or nil
end
end
|