Module:transliteration policy

local require_when_needed = require("Module:utilities/require when needed")

local process_params = require("Module:parameters").process local format_categories = require_when_needed("Module:utilities", "format_categories")

local export = {}

function export.show(frame) local args = process_params(frame:getParent.args, {		[1] = {required = true, list = true, type = "language", default = "und"},	}) local nsText = mw.title.getCurrentTitle.nsText

local shortcuts = {} local language_links = {} local categories = {} for _, lang in ipairs(args[1]) do table.insert(shortcuts, "WT:" .. lang:getFullCode:upper .. " TR") table.insert(language_links, lang:makeCategoryLink) table.insert(categories, lang:getCategoryName) end

local premise = "These are the rules concerning transliteration in " .. mw.text.listToText(language_links) .. " entries."

return frame:expandTemplate{title = "shortcut", args = shortcuts} .. premise .. (nsText == "Wiktionary" and #categories > 0 and (format_categories(categories, nil, "Transliteration", nil, true) .. "") or "") end

return export