Ugrás a tartalomhoz

Modul:R:Pons

A Wikiszótárból, a nyitott szótárból

A modult a Modul:R:Pons/doc lapon tudod dokumentálni

local export = {}
 
local chart = { ['ar']='arabic',
['ar']='arabic',
['is']='icelandic',
['bg']='bulgarian',
['zh']='chinese',
['hr']='croatian',
['cs']='czech',
['da']='danish',
['nl']='dutch',
['en']='english',
['fi']='finnish',
['fr']='french',
['de']='german',
['el']='greek',
['hu']='hungarian',
['it']='italian',
['ja']='japanese',
['la']='latin',
['no']='norwegian',
['fa']='persian',
['pl']='polish',
['pt']='portuguese',
['ro']='romanian',
['ru']='russian',
['sr']='serbian',
['sk']='slovakian',
['sl']='slovenian',
['es']='spanish',
['sv']='swedish',
['tr']='turkish'
 }

function export.create(frame)
	local args = frame:getParent().args
	local title = mw.title.getCurrentTitle().text
	local title_url = mw.uri.encode(title, QUERY)
	local code1 = args[1]
	local code2 = args[2]

	local langFrom =  mw.ustring.gsub(code1,'..',chart)
	local langTo =  mw.ustring.gsub(code2,'..',chart)
	local link = ""
	if args == '' then
		link = "[https://en.pons.com/translate PONS]"
	else
		link = "[https://en.pons.com/translate/"..langFrom.."-"..langTo.."/"..title_url.." "..title.."] - PONS (" ..args[1].."-"..args[2]..")"
	end
	return link
end
 
return export