Dokumentizo por ica modulo povas kreesar ye Modulo:lingui2/dokumentado

-- Modulo por krear listo di tradukuri por lingui
 
-- Adkargas la linguo-nomi a la tabelo
local languages = mw.loadData("Modulo:lingui2/nomi");
local p = {};

-- Helpanto-funciono efacas spaci
local function trimstr(s)
  return (s:gsub("^%s*(.-)%s*$", "%1"));
end

local function formatLang(code, name, index, extention)
	local result = '';
    local margin = '';
	result = result .. "* [[" .. name .. "#Ido|" .. name .. "]]";
	if index ~= nil and index ~= "" then
		local indexes = {
		["в"] = "linguo reduktita",
		["a"] = "linguo artificala",
		["r"] = "linguo rikonstruktita",
		["f"] = "linguo fantaziala",
		["†"] = "linguo mortinta"
		}
		local title = indexes[index] or '';
		if title ~= '' then
			title = " title='" .. title .. "'";
		end
		result = result .. " <span style='color:#55ACEE; font-size:75%;'" .. title .. ">(" .. index .. ")</span>";
		margin = ';margin-left: 0px';
	end
	if code ~= nil and code ~= "" then
	result = result .. " <span style='color:#55ACEE; font-size:75%;" .. margin .. "'>(" .. code .. ")</span>";
	end
	if extention ~= nil and extention ~= "" then
	result = result .. " " .. extention;
	end
	return result;
end

function p.list(frame)
  local result = "";
  local names = {};
  local nnames = {};
  local key = "";
  local cnt = 0;
  local demo = frame.args['demo'];
  if demo ~= nil and demo ~= "" then
    for code,v in pairs(languages) do
      key = v[2];
      if v[4] ~= nil and v[4] ~= "" then
        key = key .. v[4];
      end
      table.insert(nnames, key);
      names[key] = { code = v[1], name = v[2], index = v[3],  extention = v[4], value =  code};
      cnt = cnt +1;
    end; 
  else
    for code,value in pairs(frame:getParent().args) do
      if type(code)=='string' then 
        local trimmed = trimstr(code);
        local v = trimstr(value);
        local l = languages[trimmed];
        if l ~= nil and l ~= "" and v ~= nil and v ~= "" then
          key = l[2];
          if l[4] ~= nil and l[4] ~= "" then
            key = key .. l[4];
          end
          table.insert(nnames, key);
          names[key] = { code = l[1], name = l[2], index = l[3],  extention = l[4], value = v};
          cnt = cnt +1;
        end
      end
    end
  end
  if cnt > 0 then
    table.sort(nnames);
    for i, key in ipairs(nnames) do
      local v = names[key];    
      result = result .. formatLang(v.code, v.name, v.index, v.extention);
      result = result .. ": " .. v.value .. "\n";
    end
  end
  return result
end

function p.ref(frame)
	local result = "";
	local args = frame.args;
	if args[1] == nil then
		args = frame:getParent().args;
	end
	local code = args[1];
	if type(code) == 'string' then
		local trimmed = trimstr(code);
		local l = languages[trimmed];
		if l ~= nil then
			result = result .. formatLang(l[1], l[2], l[3], l[4]);
		end
	end
	if result == '' then
		result = tostring(code);
	end
	return result;
end

return p