48,406
edits
No edit summary |
No edit summary |
||
| (5 intermediate revisions by the same user not shown) | |||
| Line 11: | Line 11: | ||
local sort = table.sort | local sort = table.sort | ||
local u = m_str_utils.char | local u = m_str_utils.char | ||
local unpack = unpack or table.unpack -- Lua 5.2 compatibility | |||
local upper = string.upper | local upper = string.upper | ||
| Line 33: | Line 34: | ||
local default_form_types = { | local default_form_types = { | ||
{key = "cardinal", display = "[[cardinal number|Cardinal]]"}, | {key = "cardinal", display = "[[w:cardinal number|Cardinal]]"}, | ||
{key = "ordinal", display = "[[ordinal number|Ordinal]]"}, | {key = "ordinal", display = "[[w:ordinal number|Ordinal]]"}, | ||
{key = "ordinal_abbr", display = "[[ordinal number|Ordinal]] [[abbreviation]]"}, | {key = "ordinal_abbr", display = "[[w:ordinal number|Ordinal]] [[w:abbreviation]]"}, | ||
{key = "adverbial", display = "[[adverbial number|Adverbial]]"}, | {key = "adverbial", display = "[[w:adverbial number|Adverbial]]"}, | ||
{key = "multiplier", display = "[[multiplier|Multiplier]]"}, | {key = "multiplier", display = "[[w:multiplier|Multiplier]]"}, | ||
{key = "distributive", display = "[[distributive number|Distributive]]"}, | {key = "distributive", display = "[[w:distributive number|Distributive]]"}, | ||
{key = "collective", display = "[[collective number|Collective]]"}, | {key = "collective", display = "[[w:collective number|Collective]]"}, | ||
{key = "fractional", display = "[[fractional|Fractional]]"}, | {key = "fractional", display = "[[w:fractional|Fractional]]"}, | ||
} | } | ||
| Line 54: | Line 55: | ||
lower = true, | lower = true, | ||
} | } | ||
--[=[ | --[=[ | ||
| Line 479: | Line 475: | ||
local left_q = formobj.q and require("Module:qualifier").format_qualifier(formobj.q) .. " " or "" | local left_q = formobj.q and require("Module:qualifier").format_qualifier(formobj.q) .. " " or "" | ||
local right_q = formobj.qq and " " .. require("Module:qualifier").format_qualifier(formobj.qq) or "" | local right_q = formobj.qq and " " .. require("Module:qualifier").format_qualifier(formobj.qq) or "" | ||
local term = maybe_unaffix(m_data, formobj.form) | |||
local alt = nil | |||
if term ~= formobj.form then alt = formobj.form end | |||
return left_q .. m_links.full_link{ | return left_q .. m_links.full_link{ | ||
lang = lang, term = | lang = lang, term = term, alt = alt, tr = formobj.tr, | ||
} .. right_q | } .. right_q | ||
end | end | ||
| Line 496: | Line 495: | ||
local parent_args = frame:getParent().args | local parent_args = frame:getParent().args | ||
local args = require("Module:parameters").process(parent_args, params, nil, "number list", "show_box") | local args = require("Module:parameters").process(parent_args, params, nil, "number list", "show_box") | ||
| Line 999: | Line 995: | ||
local appendix2 = canonical_name .. " numbers" | local appendix2 = canonical_name .. " numbers" | ||
local appendix | local appendix | ||
local | local title = appendix2 | ||
local function format_cell(contents, class_name, colspan, bold) | local function format_cell(contents, class_name, colspan, bold) | ||
| Line 1,130: | Line 1,120: | ||
local optional2_title = args.opt2 | local optional2_title = args.opt2 | ||
local optional2_term = args.opt2x; local optional2_alt = args.opt2xalt; local optional2_tr = args.opt2xtr | local optional2_term = args.opt2x; local optional2_alt = args.opt2xalt; local optional2_tr = args.opt2xtr | ||
local subpage = mw.title.getCurrentTitle().subpageText | local subpage = mw.title.getCurrentTitle().subpageText | ||
| Line 1,193: | Line 1,161: | ||
if cardinal_term then | if cardinal_term then | ||
insert(forms, " ''[[cardinal number|Cardinal]]'' : " .. m_links.full_link{lang = lang, sc = sc, term = cardinal_term, alt = cardinal_alt, tr = cardinal_tr}) | insert(forms, " ''[[wikt:cardinal number|Cardinal]]'' : " .. m_links.full_link{lang = lang, sc = sc, term = cardinal_term, alt = cardinal_alt, tr = cardinal_tr}) | ||
end | end | ||
if ordinal_term then | if ordinal_term then | ||
insert(forms, " ''[[ordinal number|Ordinal]]'' : " .. m_links.full_link{lang = lang, sc = sc, term = ordinal_term, alt = ordinal_alt, tr = ordinal_tr}) | insert(forms, " ''[[wikt:ordinal number|Ordinal]]'' : " .. m_links.full_link{lang = lang, sc = sc, term = ordinal_term, alt = ordinal_alt, tr = ordinal_tr}) | ||
end | end | ||
if adverbial_term then | if adverbial_term then | ||
insert(forms, " ''[[adverbial number|Adverbial]]'' : " .. m_links.full_link{lang = lang, sc = sc, term = adverbial_term, alt = adverbial_alt, tr = adverbial_tr}) | insert(forms, " ''[[wikt:adverbial number|Adverbial]]'' : " .. m_links.full_link{lang = lang, sc = sc, term = adverbial_term, alt = adverbial_alt, tr = adverbial_tr}) | ||
end | end | ||
if multiplier_term then | if multiplier_term then | ||
insert(forms, " ''[[multiplier|Multiplier]]'' : " .. m_links.full_link{lang = lang, sc = sc, term = multiplier_term, alt = multiplier_alt, tr = multiplier_tr}) | insert(forms, " ''[[wikt:multiplier|Multiplier]]'' : " .. m_links.full_link{lang = lang, sc = sc, term = multiplier_term, alt = multiplier_alt, tr = multiplier_tr}) | ||
end | end | ||
if distributive_term then | if distributive_term then | ||
insert(forms, " ''[[distributive number|Distributive]]'' : " .. m_links.full_link{lang = lang, sc = sc, term = distributive_term, alt = distributive_alt, tr = distributive_tr}) | insert(forms, " ''[[wikt:distributive number|Distributive]]'' : " .. m_links.full_link{lang = lang, sc = sc, term = distributive_term, alt = distributive_alt, tr = distributive_tr}) | ||
end | end | ||
if collective_term then | if collective_term then | ||
insert(forms, " ''[[collective number|Collective]]'' : " .. m_links.full_link{lang = lang, sc = sc, term = collective_term, alt = collective_alt, tr = collective_tr}) | insert(forms, " ''[[wikt:collective number|Collective]]'' : " .. m_links.full_link{lang = lang, sc = sc, term = collective_term, alt = collective_alt, tr = collective_tr}) | ||
end | end | ||
if fractional_term then | if fractional_term then | ||
insert(forms, " ''[[fractional|Fractional]]'' : " .. m_links.full_link{lang = lang, sc = sc, term = fractional_term, alt = fractional_alt, tr = fractional_tr}) | insert(forms, " ''[[wikt:fractional|Fractional]]'' : " .. m_links.full_link{lang = lang, sc = sc, term = fractional_term, alt = fractional_alt, tr = fractional_tr}) | ||
end | end | ||