Module:R:Duden

Definition from Wiktionary, the free dictionary
Jump to: navigation, search
The following documentation is located at Module:R:Duden/documentation. [edit]
Useful links: subpage listtransclusionstestcases

This module implements {{R:Duden}}.


local export = {}
 
local chart = { ['ä']='ae', ['ö']='oe', ['ü']='ue',
                ['Ä']='Ae', ['Ö']='Oe', ['Ü']='Ue',
                ['ß']='sz', ['-']='_'              }
 
function export.create(frame)
	local args = frame:getParent().args
	local title = args['w'] or mw.title.getCurrentTitle().text
	local termURLCode = args[1] or mw.ustring.gsub(title,'[äöüÄÖÜß-]',chart)
	local link = ""
	if termURLCode == '' then
		link = "''Duden'' online"
	else
		link = "[http://www.duden.de/rechtschreibung/"..termURLCode..' '..title.."] in ''Duden'' online"
	end
	return link
end
 
return export