模块:Phrases
来自「荏苒之境」
此模块的文档可以在模块:Phrases/doc创建
local translation = require("Module:Template translation")
local cargo = mw.ext.cargo
local phrases = {}
phrases.show = function(frame)
local table_name = frame.args.table
local theme = frame.args.theme
local parent_frame = frame:getParent()
local language = translation.getCurrentLanguageSubpage()
if language == nil or language == "" then
language = "zh-cn"
end
cargo.store("PhraseThemes", {
PhraseTable = table_name,
Theme = theme,
Full = table_name.."_"..theme
})
local t = {"<p><b>[[世界标识码]]:", theme, "</p><ul>"}
for _, phrase in ipairs(parent_frame.args) do
cargo.store(table_name, {
Language = language,
Phrase = phrase,
Theme = theme
})
t[#t+1] = "<li>"
t[#t+1] = frame:preprocess(phrase)
t[#t+1] = "</li>"
end
t[#t+1] = "</ul>"
return table.concat(t)
end
return phrases