Content deleted Content added
add languageSpan and lang function and rewrite wikt |
restructure again |
||
Line 49:
function f.lang(frame)
return languageSpan(frame.args[1], frame.args[2])
function wiktionaryLink(languageCode, entry, linkText)
if languageCode then
error("Language code is not recognized")▼
end
languageName = languageData["name"]
if entry and linkText then
return languageSpan(languageCode, "[[wikt:" .. entry .. "#" .. languageName .. "|" .. linkText .. "]]")
else
error("Either the entry or the link text is missing")
end
else
error("Please provide a language code in the first parameter")
end
end
Line 55 ⟶ 73:
local word1 = frame.args[2]
local word2 = frame.args[3]
▲ local languageData = data[languageCode]
▲ local languageName = languageData["name"]
▲ if languageData == nil then
▲ error("Language code is not recognized")
▲ end
if languageCode then
if word2 and word1 then
Line 72 ⟶ 84:
end
else
error("Please
end
return languageSpan(languageCode,
end
|