Module:Wikt-lang: Difference between revisions

Content deleted Content added
renaming function
adding a Wiktionary link function that doesn't have italics or language tagging, so words can be linked in the middle of texts
Line 315:
end
local out = (languageCode and entry and linkText and tag(linkToWiktionary(entry, linkText, languageCode), languageCode, scriptCode, italics) ) or entry and linkText and linkToWiktionary(entry, linkText) or '<span style="font-size: smaller;">[text?]</span>'
return out and out .. errorMessage or errorMessage or error("The function wiktlang generated nothing")
end
 
function p.wikt(frame)
local parent = frame:getParent()
local args = parent.args[1] and parent.args or frame.args
local codes = args[1] or nil
local word1 = args[2] or nil
local word2 = args[3] or nil
local languageCode, scriptCode, errorText = getCodes(codes, word1)
local errorMessage = errorText
local out = (languageCode and entry and linkText and linkToWiktionary(entry, linkText, languageCode) ) or entry and linkText and linkToWiktionary(entry, linkText) or '<span style="font-size: smaller;">[text?]</span>'
return out and out .. errorMessage or errorMessage or error("The function wikt generated nothing")
end