Springe nei ynhâld

Module:labels/data/functions

Ut Wikiwurdboek
De neikommende dokumintaasje stiet op Module:labels/data/functions/dokumintaasje. [bewurkje]

Oernommen fan en:Module:labels/data/functions.

Oerset:

  • foutmelding

export = {}

function export.handle_languages(labels)
	if type(labels) ~= "table" then
		error('De funksje "handle_languages" hat in tabel as argumint nedich.')
	end
	
	for label, data in pairs(labels) do
		if data["languages"] then
			for key, language in ipairs(data["languages"] or {}) do
				labels[label]["languages"][language] = true
			end
		elseif data["language"] and data["language"] ~= "" then
			labels[label]["languages"] = {}
			labels[label]["languages"][data["language"]] = true
		end
	end
end

return export