Lompat ke isi

Modul:R:Duden

Dari Wikikamus bahasa Indonesia, kamus bebas

Dokumentasi untuk modul ini dapat dibuat di Modul:R:Duden/doc

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

function export.create(frame)

   local params = {
		[1] = {},
		[2] = {},
		["w"] = {alias_of = 2},
	}
	local args = require("Module:parameters").process(frame:getParent().args, params)

	local title = args[2] 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 = "“[https://www.duden.de/rechtschreibung/"..termURLCode..' '..mw.text.nowiki(title) .."]” di ''Duden'' online"
	end
	return link
end
 
return export