Module:Project I18n

-- local p = {}

local languages = { 'ar', 'be', 'ca', 'de', 'el', 'es', 'fr', 'it', 'nl', 'pl', 'pt', 'ro', 'ru', 'tr', 'zh', 'zh-hans', 'zh-hant' }

function p.langs(frame) local selected = frame.args[1] local supported = false for i, lang in ipairs(languages) do       supported = supported and true or lang == selected end selected = supported and selected or 'pl' local wikitext = tostring(       mw.html.create('strong')            :addClass('selflink')            :wikitext(mw.language.fetchLanguageName(selected))    ) for i, lang in ipairs(languages) do       if lang ~= selected then wikitext = wikitext .. ' • [' .. tostring(mw.uri.fullUrl(mw.title.getCurrentTitle.prefixedText, {uselang = lang})) .. ' ' .. mw.language.fetchLanguageName(lang) .. ']'       end end return frame and frame:preprocess(wikitext) or mw.text.nowiki(wikitext) end

function p.scripts(frame) local wikitext = '' local selected = frame.args[1] local supported = false for i, lang in ipairs(languages) do       supported = supported and true or lang == selected end selected = supported and selected or 'pl' local name = mw.language.fetchLanguageName(selected) local wikitext = frame:preprocess(       ''    ) return frame:preprocess(result) end

function p.pages(frame) local wikitext = '' local dpl1 = '' --.. dpl .. '| offset = 500}}' end return frame:preprocess(' ' .. wikitext .. ' ') end

return p