Jump to content

Module:R:DGE

From Wiktionary, the free dictionary

This module implements {{R:DGE}}.


local get_lang = require("Module:languages").getByCode
local process_params = require("Module:parameters").process
local tag_text = require("Module:script utilities").tag_text
local uri_encode = mw.uri.encode

local export = {}

function export.create(frame)
	local args = process_params(frame:getParent().args, {
		[1] = true,
		[2] = true,
	})
	
	local target = args[1] or mw.loadData("Module:headword/data").pagename
	
	return ("[http://dge.cchs.csic.es/xdge/%s %s] in the ''[[w:Diccionario Griego–Español|Diccionario Griego–Español]]'' en línea (2006–%s)"):format(
		uri_encode(target, "PATH"),
		tag_text(args[2] or target, get_lang("grc")),
		os.date("%Y")
	)
end
 
return export