Module:headword: Difference between revisions
No edit summary Tag: Manual revert |
No edit summary |
||
| (7 intermediate revisions by the same user not shown) | |||
| Line 425: | Line 425: | ||
local langname = data.lang:getCanonicalName() | local langname = data.lang:getCanonicalName() | ||
local transliteration_page = new_title(langname .. " transliteration | local transliteration_page = new_title(langname .. " transliteration") | ||
local saw_translit_page = false | local saw_translit_page = false | ||
if transliteration_page and transliteration_page:getContent() then | if transliteration_page and transliteration_page:getContent() then | ||
translits_formatted = " [[ | translits_formatted = " [[" .. langname .. " transliteration|•]]" .. translits_formatted | ||
saw_translit_page = true | saw_translit_page = true | ||
end | end | ||
| Line 620: | Line 620: | ||
local title = mw.title.new(stripped_physical_term) | local title = mw.title.new(stripped_physical_term) | ||
if title and not title:getContent() then | if title and not title:getContent() then | ||
return true | return true | ||
end | end | ||
| Line 789: | Line 788: | ||
-- that. | -- that. | ||
if tbl == true then | if tbl == true then | ||
return | return | ||
end | end | ||
| Line 801: | Line 797: | ||
different = true | different = true | ||
end | end | ||
end | end | ||
return sortkey | return sortkey | ||
| Line 818: | Line 808: | ||
if tbl then | if tbl then | ||
sortkey = handle_raw_sortkeys(tbl, sortkey, page, lang, lang_cats) | sortkey = handle_raw_sortkeys(tbl, sortkey, page, lang, lang_cats) | ||
end | end | ||
tbl = page.wikitext_langname_cat[canonical] | tbl = page.wikitext_langname_cat[canonical] | ||
if tbl then | if tbl then | ||
handle_raw_sortkeys(tbl, sortkey, page, lang, lang_cats) | handle_raw_sortkeys(tbl, sortkey, page, lang, lang_cats) | ||
end | end | ||
end | end | ||
| Line 965: | Line 947: | ||
-- add an appropriate category. | -- add an appropriate category. | ||
local postype = export.pos_lemma_or_nonlemma(data.pos_category) | local postype = export.pos_lemma_or_nonlemma(data.pos_category) | ||
local main_cat = data.lang:getMainCategoryName() | |||
if not postype then | |||
elseif not data.noposcat then | |||
if postype:match("^lemma") and main_cat ~= "lemma" then | |||
postype = main_cat | |||
end | |||
insert(data.categories, 1, full_langname .. " " .. postype .. "s") | |||
end | |||
insert(data.categories, 1, "Contionary") | |||
-- EXPERIMENTAL: see [[Wiktionary:Beer parlour/2024/June#Decluttering the altform mess]] | -- EXPERIMENTAL: see [[Wiktionary:Beer parlour/2024/June#Decluttering the altform mess]] | ||
| Line 1,011: | Line 992: | ||
end | end | ||
if is_reconstructed then | if is_reconstructed and not data.lang:hasType("conlang") then | ||
default_head = "*" .. default_head | default_head = "*" .. default_head | ||
end | end | ||
| Line 1,064: | Line 1,045: | ||
local auto_sc = data.lang:findBestScript(head.term) | local auto_sc = data.lang:findBestScript(head.term) | ||
if not (head.sc or data.sc) then -- No script code given, so use autodetected script. | if not (head.sc or data.sc) then -- No script code given, so use autodetected script. | ||
head.sc = auto_sc | head.sc = auto_sc | ||
| Line 1,075: | Line 1,050: | ||
if not head.sc then -- Overall script code given. | if not head.sc then -- Overall script code given. | ||
head.sc = data.sc | head.sc = data.sc | ||
end | end | ||
end | end | ||
| Line 1,124: | Line 1,087: | ||
if automated_tr then | if automated_tr then | ||
local manual_tr = head.tr | local manual_tr = head.tr | ||
if not manual_tr then | if not manual_tr then | ||
| Line 1,470: | Line 1,425: | ||
insert(data.categories, full_langname .. " terms spelled with " .. character) | insert(data.categories, full_langname .. " terms spelled with " .. character) | ||
end | end | ||
end | end | ||
end | end | ||