47,637
edits
Tag: Undo |
No edit summary |
||
Line 1: | Line 1: | ||
local export = {} | local export = {} | ||
local force_cat = false -- for testing | |||
local m_form_of = require("Module:form of") | local m_form_of = require("Module:form of") | ||
Line 267: | Line 269: | ||
table.insert(categories, cat) | table.insert(categories, cat) | ||
end | end | ||
local text = form_of_text .. ( | |||
args["nodot"] and "" or args["dot"] or iargs["withdot"] and "." or "" | args["nodot"] and "" or args["dot"] or iargs["withdot"] and "." or "" | ||
) .. require("Module:utilities").format_categories(categories, lang, args["sort"]) | ) | ||
if #categories == 0 then | |||
return text | |||
end | |||
return text .. require("Module:utilities").format_categories(categories, lang, args["sort"], nil, force_cat) | |||
end | end | ||
Line 403: | Line 409: | ||
local text = args["notext"] and "" or iargs[1] | local text = args["notext"] and "" or iargs[1] | ||
if args["cap"] or iargs["withcap"] and not args["nocap"] then | if args["cap"] or iargs["withcap"] and not args["nocap"] then | ||
text = | text = require("Module:string utilities").ucfirst(text) | ||
end | end | ||
return construct_form_of_text(iargs, args, term_param, compat, | return construct_form_of_text(iargs, args, term_param, compat, | ||
function(lang, terminfo) | function(lang, terminfo) | ||
return m_form_of.format_form_of | return m_form_of.format_form_of {text = text, terminfo = terminfo, | ||
terminfo_face = "term", posttext = iargs["posttext"]}, {} | |||
end | end | ||
) | ) | ||
Line 430: | Line 437: | ||
local lang_cats = | local lang_cats = | ||
args["nocat"] and {} or m_form_of.fetch_lang_categories(lang, tags, terminfo, args["p"]) | args["nocat"] and {} or m_form_of.fetch_lang_categories(lang, tags, terminfo, args["p"]) | ||
return m_form_of.tagged_inflections | return m_form_of.tagged_inflections { | ||
tags, terminfo, args["notext"], | tags = tags, | ||
args["cap"] or iargs["withcap"] and not args["nocap"], iargs["posttext"], | terminfo = terminfo, | ||
joiner | terminfo_face = "term", | ||
notext = args["notext"], | |||
capfirst = args["cap"] or iargs["withcap"] and not args["nocap"], | |||
posttext = iargs["posttext"], | |||
joiner = joiner | |||
}, lang_cats | |||
end | end | ||
) | ) | ||
Line 703: | Line 714: | ||
return export | return export | ||