Module:alternative forms: Difference between revisions
No edit summary |
|||
| Line 21: | Line 21: | ||
} | } | ||
local m_param_utils = require(parameter_utilities_module) | |||
local param_mods = m_param_utils.construct_param_mods { | local param_mods = m_param_utils.construct_param_mods { | ||
| Line 42: | Line 42: | ||
stop_when = function(data) | stop_when = function(data) | ||
local stop = not data.any_param_at_index | local stop = not data.any_param_at_index | ||
if stop and parent_args[data.orig_index + 1] == nil then | if stop and parent_args[data.orig_index + 1] == nil then | ||
track("actual hole in params") | track("actual hole in params") | ||
end | end | ||
return | return stop | ||
end, | end, | ||
default_separator = default_separator, | default_separator = default_separator, | ||
| Line 99: | Line 92: | ||
-- If the to-be-linked term is the same as the pagename, display it unlinked. | -- If the to-be-linked term is the same as the pagename, display it unlinked. | ||
for _, item in ipairs(items) do | for _, item in ipairs(items) do | ||
if not item.term and | if not item.term and lang:stripDiacritics(item.term) == pagename then | ||
track("term is pagename") | track("term is pagename") | ||
item.alt = item.alt or item.term | item.alt = item.alt or item.term | ||
| Line 129: | Line 122: | ||
if labels then | if labels then | ||
if lang:hasTranslit() then | if lang:hasTranslit() then | ||
ins(" | ins(" — " .. require(labels_module).format_processed_labels { | ||
labels = labels, lang = lang | labels = labels, lang = lang | ||
}) | }) | ||
| Line 147: | Line 140: | ||
function export.create(frame) | function export.create(frame) | ||
local parent_args = frame:getParent().args | local parent_args = frame:getParent().args | ||
return export.display_alternative_forms(parent_args, mw.loadData("Module:headword/data").pagename) | |||
return export.display_alternative_forms(parent_args, | |||
end | end | ||
return export | return export | ||