10,594
edits
(Created page with "require('strict') local m_data = mw.loadData("Module:Wikt-lang/data") local langData = m_data.languages or m_data local p = {} local function ifNotEmpty(value) if value == "" then return nil else return value end end local function makeLinkedName(languageCode) local data = langData[languageCode] local article = data["article"] local name = data["Wikipedia_name"] or data["name"] return "" .. name .. ": " end local function makeEnt...") |
(Cleanup) Tags: Mobile edit Mobile web edit Advanced mobile edit |
||
Line 16: | Line 16: | ||
local data = langData[languageCode] | local data = langData[languageCode] | ||
local article = data["article"] | local article = data["article"] | ||
local name = data[" | local name = data["Bharatpedia_name"] or data["name"] | ||
return "[[" .. article .. "|" .. name .. "]]: " | return "[[" .. article .. "|" .. name .. "]]: " | ||
end | end | ||
Line 142: | Line 142: | ||
local function tag(text, languageCode, script, italics) | local function tag(text, languageCode, script, italics) | ||
local data = langData[languageCode] | local data = langData[languageCode] | ||
-- Use | -- Use Bharatpedia code if it has been given: for instance, | ||
-- Proto-Indo-European has the | -- Proto-Indo-European has the Bharationary code "ine-pro" but the Bharatpedia | ||
-- code "ine-x-proto". | -- code "ine-x-proto". | ||
languageCode = data and data. | languageCode = data and data.Bharatpedia_code or languageCode | ||
local italicize = script == "Latn" and italics | local italicize = script == "Latn" and italics | ||
Line 230: | Line 230: | ||
return "[[wikt:" .. entry .. "#" .. name .. "|" .. linkText .. "]]" | return "[[wikt:" .. entry .. "#" .. name .. "|" .. linkText .. "]]" | ||
else | else | ||
error(" | error("linkToBharationary needs a Wiktionary entry or link text, or both") | ||
end | end | ||
else | else | ||
Line 265: | Line 265: | ||
local out | local out | ||
if languageCode and entry and linkText then | if languageCode and entry and linkText then | ||
out = tag( | out = tag(linkToBharationary(entry, linkText, languageCode), languageCode, scriptCode, italics) | ||
elseif entry and linkText then | elseif entry and linkText then | ||
out = | out = linkToBharationary(entry, linkText) | ||
else | else | ||
out = '<span style="font-size: smaller;">[text?]</span>' | out = '<span style="font-size: smaller;">[text?]</span>' | ||
Line 304: | Line 304: | ||
local out | local out | ||
if languageCode and entry and linkText then | if languageCode and entry and linkText then | ||
out = | out = linkToBharationary(entry, linkText, languageCode) | ||
elseif entry and linkText then | elseif entry and linkText then | ||
out = | out = linkToBharationary(entry, linkText) | ||
else | else | ||
out = '<span style="font-size: smaller;">[text?]</span>' | out = '<span style="font-size: smaller;">[text?]</span>' |