Module:labels: Difference between revisions
use large_pages in Module:headword/data instead of having it here |
No edit summary |
||
| (3 intermediate revisions by the same user not shown) | |||
| Line 53: | Line 53: | ||
-- Disable tracking on heavy pages to save time. | -- Disable tracking on heavy pages to save time. | ||
local pages_where_tracking_is_disabled = m_headword_data.large_pages | local pages_where_tracking_is_disabled = m_headword_data.large_pages | ||
local function ucfirst(txt) | local function ucfirst(txt) | ||
| Line 403: | Line 382: | ||
if glossary then | if glossary then | ||
local glossary_entry = glossary == true and label or glossary | local glossary_entry = glossary == true and label or glossary | ||
formatted_label = "[[Appendix:Glossary#" .. glossary_entry .. "|" .. display .. "]]" | formatted_label = "[[wikt:Appendix:Glossary#" .. glossary_entry .. "|" .. display .. "]]" | ||
elseif Wiktionary then | elseif Wiktionary then | ||
local Wiktionary_entry = Wiktionary == true and label or Wiktionary | local Wiktionary_entry = Wiktionary == true and label or Wiktionary | ||
if Wiktionary == display then | if Wiktionary == display then | ||
formatted_label = "[[" .. display .. "]]" | formatted_label = "[[wikt:" .. display .. "]]" | ||
else | else | ||
formatted_label = "[[" .. Wiktionary_entry .. "|" .. display .. "]]" | formatted_label = "[[wikt:" .. Wiktionary_entry .. "|" .. display .. "]]" | ||
end | end | ||
elseif Wikipedia then | elseif Wikipedia then | ||
| Line 585: | Line 564: | ||
label = resolved_label or label | label = resolved_label or label | ||
break | break | ||
end | end | ||
end | end | ||
| Line 615: | Line 583: | ||
-- Note that this is an alias and store the canonical version. | -- Note that this is an alias and store the canonical version. | ||
ret.canonical = label | ret.canonical = label | ||
end | end | ||
| Line 758: | Line 714: | ||
local function get_info_and_insert(label) | local function get_info_and_insert(label) | ||
-- Reuse this structure to save memory. | -- Reuse this structure to save memory. | ||
data.label = label | data.label = require("Module:links").embedded_language_links{term = label, lang = data.lang} | ||
insert(label_infos, export.get_label_info(data)) | insert(label_infos, export.get_label_info(data)) | ||
end | end | ||