Module:R:DGE

local export = {}

function export.create(frame) local args = frame:getParent.args local title = args['w'] or mw.title.getCurrentTitle.text local title_span = ' '..title..' ' -- replace U+03CC GREEK SMALL LETTER OMICRON WITH TONOS (ό) -- with U+1F79 GREEK SMALL LETTER OMICRON WITH OXIA; -- the DGE website only accepts the latter. -- See Template talk:R:DGE. local term = (args[1] or title):gsub(mw.ustring.char(0x03CC), mw.ustring.char(0x1F79)) local termURLCode = mw.uri.encode(term, "PATH") local year = os.date("%Y") local link = "" if termURLCode == '' then link = "Diccionario Griego–Español en línea (2006–"..year..")" else link = "'..title_span.." in the Diccionario Griego–Español en línea (2006–"..year..")" end return link end return export