Module:R:The Bokmål and Nynorsk dictionaries
Itsura
- This module lacks a documentation subpage. Please create it.
- Useful links: subpage list • links • transclusions • testcases • sandbox
local p = {}
function p.main(frame)
local templateLang = frame.args[1]
local params = {
[1] = {},
["lang"] = {},
}
local args = require("Module:parameters").process(frame:getParent().args, params)
local lang
if templateLang and templateLang ~= '' then
lang = templateLang
else
if args['lang'] then
lang = args['lang']
else
lang = 'no'
end
end
if lang == 'nb' then
specifier = 'bm'
specifier2 = "''The Bokmål Dictionary''"
elseif lang == 'nn' then
specifier = 'nn'
specifier2 = "''The Nynorsk Dictionary''"
elseif lang == 'no' then
specifier = 'bm,nn'
specifier2 = "''The Bokmål Dictionary'' / ''The Nynorsk Dictionary''"
end
target = args[1] or mw.title.getCurrentTitle().text
template = "[https://ordbokene.no/" .. specifier .. "/search?q=" .. (mw.ustring.gsub(target, " ", "%%20")) ..
" “" .. target .. "”] in " .. specifier2 .. "."
return template
end
return p