Module:R:The Bokmål and Nynorsk dictionaries

Hello, you have come here looking for the meaning of the word Module:R:The Bokmål and Nynorsk dictionaries. In DICTIOUS you will not only get to know all the dictionary meanings for the word Module:R:The Bokmål and Nynorsk dictionaries, but we will also tell you about its etymology, its characteristics and you will know how to say Module:R:The Bokmål and Nynorsk dictionaries in singular and plural. Everything you need to know about the word Module:R:The Bokmål and Nynorsk dictionaries you have here. The definition of the word Module:R:The Bokmål and Nynorsk dictionaries will help you to be more precise and correct when speaking or writing your texts. Knowing the definition ofModule:R:The Bokmål and Nynorsk dictionaries, as well as those of other words, enriches your vocabulary and provides you with more and better linguistic resources.

This module is used by Template:R:The Bokmål and Nynorsk dictionaries to interface with these two dictionaries. That template is in turn used by Template:R:The_Nynorsk_Dictionary and Template:R:The_Bokmål_Dictionary. See documentation there for usage information. This module should normally NOT be called directly, but be used through those templates.

This module is called like this:

{{#invoke:R:The Bokmål and Nynorsk dictionaries|main}}

Optionally, one of the dictionaries may be chosen, either Nynorsk – nn – or Bokmål – nb, e.g.:

{{#invoke:R:The Bokmål and Nynorsk dictionaries|main|nn}}

local p = {}

function p.main(frame)

	local templateLang = frame.args
	local params = {
		 = {},
		 = {},
	}
	local args = require("Module:parameters").process(frame:getParent().args, params)

	local lang

	if templateLang and templateLang ~= '' then
		lang = templateLang
	else
		if args then
			lang = args
		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 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