Module:R:Grimm

From Wiktionary, the free dictionary
Jump to navigation Jump to search
A user has added this module page to requests for deletion(+).
Please see that page for discussion and justifications beyond the initial comment of: “Superseded by Module:R:Wörterbuchnetz. You may continue to edit this module page while the discussion proceeds, but please mention significant edits at the RFD discussion and ensure that the intention of votes already cast is not left unclear. Do not remove the {{rfd}} until the debate has finished.

local export = {}
 
local chart = { ['ä']='ae', ['ö']='oe', ['ü']='ue',
                ['Ä']='Ae', ['Ö']='Oe', ['Ü']='Ue',
                ['ß']='sz', ['-']='_'              }

function export.create(frame)
	local args = frame:getParent().args
	if args['w'] and args[2] then
		error("please specify only either |w= or |2=")
	end
	local title = args['w'] or args[2] or mw.title.getCurrentTitle().text
	local termURLCode = args[1] or mw.ustring.gsub(title,'[äöüÄÖÜß-]',chart)
	local dictionary = args['dictionary'] or "DWB"
	local link = ""
	
	if termURLCode == '' then
		link = "''Deutsches Wörterbuch von Jacob und Wilhelm Grimm'', 16 vols., Leipzig 1854–1961."
	else
		link = "“[https://woerterbuchnetz.de/?sigle="..dictionary.."&lemma="..termURLCode..' '..title.."]” in ''[[w:Deutsches Wörterbuch|Deutsches Wörterbuch von Jacob und Wilhelm Grimm]]'', 16 vols., Leipzig 1854–1961."
	end
	return link
end
 
return export