Module:km-pron/generate

Avy amin'i Wikibolana — Rakibolana malagasy malalaka

La documentation pour ce module peut être créée à Module:km-pron/generate/doc

local export = {}
local m_links = require("Module:links")
local test_data = require('Module:km-pron/testcases/data')

function export.make(frame)
	local result, args = {}, {}
	for _, data in pairs(test_data) do
		local args = mw.text.split(data.respelling or data.word, ", ")
		args["word"] = data.word
		
		table.insert(result, 
			"<h3>" .. 
			
			m_links.language_link({ 
				term = data.word, 
				lang = require("Module:languages").getByCode("km") 
			}) .. 
		
			"</h3>\n" .. 
			
			"<pre>{{km-IPA" .. 
			(data.respelling and "|" .. mw.ustring.gsub(data.respelling, ", ", "|") or "") ..
			"}}</pre>\n" ..
			
			mw.getCurrentFrame():expandTemplate{
			title = "Template:km-IPA",
			args = args} .. "\n\n")
	end
	return table.concat(result)
end

return export