Module:category tree/languages: Difference between revisions

No edit summary
 
m top: clean up
 
(3 intermediate revisions by the same user not shown)
Line 43: Line 43:




raw_categories["All languages"] = {
raw_categories["Languages"] = {
topright = "{{commonscat|Languages}}\n[[File:Languages world map-transparent background.svg|thumb|right|250px|Rough world map of language families]]",
topright = "{{commonscat|Languages}}\n[[File:Languages world map-transparent background.svg|thumb|right|250px|Rough world map of language families]]",
description = "This category contains the categories for every language on Wiktionary.",
description = "This category contains the categories for every language on Wiktionary.",
Line 52: Line 52:
"Fundamental",
"Fundamental",
},
},
breadcrumb = "All languages",
}
}


raw_categories["All extinct languages"] = {
raw_categories["All extinct languages"] = {
description = "This category contains the categories for every [[extinct language]] on Wiktionary.",
description = "This category contains the categories for every [[wikt:extinct language|extinct language]] on Wiktionary.",
additional = "Do not confuse this category with [[:Category:Extinct languages]], which is an umbrella category for the names of extinct languages in specific other languages (e.g. {{m+|de|Langobardisch}} for the ancient [[Lombardic]] language).",
additional = "Do not confuse this category with [[:Category:Extinct languages]], which is an umbrella category for the names of extinct languages in specific other languages (e.g. {{m+|de|Langobardisch}} for the ancient [[wikt:Lombardic|Lombardic]] language).",
parents = {
parents = {
"All languages",
"Languages",
},
},
}
}
Line 67: Line 68:
additional = "{{{umbrella_meta_msg}}}",
additional = "{{{umbrella_meta_msg}}}",
parents = {
parents = {
"All languages",
"Languages",
},
},
}
}
Line 100: Line 101:
for template in require("Module:template parser").find_templates(contents) do
for template in require("Module:template parser").find_templates(contents) do
-- The template parser automatically handles redirects and canonicalizes them, so uses of {{autocat}}
-- The template parser automatically handles redirects and canonicalizes them, so uses of {{autocat}}
-- will also be found.
-- will also be\[\[Appendix:Glossary\#([^|]+)\|\1\]\] found.
if template:get_name() == "auto cat" then
if template:get_name() == "auto cat" then
return template:get_arguments()
return template:get_arguments()
Line 117: Line 118:
local bare_location_parts = split(bare_location, ", ")
local bare_location_parts = split(bare_location, ", ")
for i, part in ipairs(bare_location_parts) do
for i, part in ipairs(bare_location_parts) do
bare_location_parts[i] = ("[[%s]]"):format(part)
bare_location_parts[i] = ("[[wikt:%s|%s]]"):format(part, part)
end
end
location_link = concat(bare_location_parts, ", ")
location_link = concat(bare_location_parts, ", ")
Line 556: Line 557:
end
end
location_desc = ("It is %s %s %s.\n\n"):format(
location_desc = ("It is %s %s %s.\n\n"):format(
extinct and "an [[extinct language]] that was formerly spoken" or "spoken", prep, location_link_text)
extinct and "an [[wikt:extinct language|extinct language]] that was formerly spoken" or "spoken", prep, location_link_text)
elseif extinct then
elseif extinct then
location_desc = "It is an [[extinct language]].\n\n"
location_desc = "It is an [[wikt:extinct language|extinct language]].\n\n"
else
else
location_desc = ""
location_desc = ""
Line 584: Line 585:
if entry_guidelines.exists then
if entry_guidelines.exists then
add = add .. "\n\n" ..
add = add .. "\n\n" ..
"Please see '''[[" .. entry_guidelines_page .. "]]''' for information and special considerations for creating " .. nameWithLanguage .. " entries."
"Please see '''[[wikt:" .. entry_guidelines_page .. "|" .. entry_guidelines_page .. "]]''' for information and special considerations for creating " .. nameWithLanguage .. " entries."
end
end
Line 615: Line 616:
local sortkey = {sort_base = canonicalName, lang = "en"}
local sortkey = {sort_base = canonicalName, lang = "en"}
local ret = {{name = "All languages", sort = sortkey}}
local ret = {{name = "Languages", sort = sortkey}}
local fam = lang:getFamily()
local fam = lang:getFamily()
Line 929: Line 930:
return {
return {
lang = lang:getCode(),
lang = lang:getCode(),
description = "Languages which developed as a [[creole]] or [[pidgin]] from " .. lang:makeCategoryLink() .. ".",
description = "Languages which developed as a [[wikt:creole|creole]] or [[wikt:pidgin|pidgin]] from " .. lang:makeCategoryLink() .. ".",
parents = {{name = "Creole or pidgin languages", sort = {sort_base = "*" .. langname, lang = "en"}}},
parents = {{name = "Creole or pidgin languages", sort = {sort_base = "*" .. langname, lang = "en"}}},
breadcrumb = lang:getCanonicalName() .. "-based",
breadcrumb = lang:getCanonicalName() .. "-based",