Jump to content
Toggle menu
  • 8 articles
  • 75 files
  • 7 users
  • 37.8K edits
Neodyland Wiki
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.
Revision as of 05:00, 24 January 2024 by commons>Jarekt
Module documentation[ create · purge ]
This documentation is transcluded from Module:Lang links/doc.
 --  __  __           _       _        _                        _ _       _        
 -- |  \/  | ___   __| |_   _| | ___ _| |    __ _ _ __   __ _  | (_)_ __ | | _____ 
 -- | |\/| |/ _ \ / _` | | | | |/ _ (_) |   / _` | '_ \ / _` | | | | '_ \| |/ / __|
 -- | |  | | (_) | (_| | |_| | |  __/_| |__| (_| | | | | (_| | | | | | | |   <\__ \
 -- |_|  |_|\___/ \__,_|\__,_|_|\___(_)_____\__,_|_| |_|\__, | |_|_|_| |_|_|\_\___/
                                                     -- |___/                      
require('strict') -- used for debugging purposes as it detects cases of unintended global variables

local p = {}

function p.lang_links(frame)
    local title = frame.args[1]

	-- This list was generated by collecting all the templates from 
	-- [[Category:Translated marker templates]] and [[Category:Translated license tags]]
	-- and counting how many subtemplates from each language we have. This is top 50 list.
	local list = {'ar', 'be-tarask', 'bg', 'bn', 'ca', 'cs', 'da', 'de', 
		'el', 'en', 'eo', 'es', 'et', 'eu', 'fa', 'fi', 'fr', 'gl', 'he', 
		'hi', 'hr', 'hu', 'hy', 'id', 'it', 'ja', 'ko', 'mk', 'ml', 'ms', 
		'nb', 'nds', 'nl', 'pl', 'pt', 'pt-br', 'ro', 'ru', 'scn', 'sk', 
		'sl', 'sr', 'sv', 'th', 'tr', 'uk', 'vi', 'zh', 'zh-hans', 'zh-hant'}
	local output = {}
	for _, lang in pairs( list ) do
		local subpage = title .. '/' .. lang
		if mw.title.new(subpage).exists then
			local lname = mw.language.fetchLanguageName( lang, lang )
			table.insert(output, '[[' .. subpage .. '|<bdi lang="'..lang..'">'.. lname..'</bdi>]]')
		end
	end 
	
	local subpage = title .. '/lang'
	if mw.title.new(subpage).exists then
		table.insert(output, '[[' .. subpage .. '|+/−]]')
	end
	return table.concat(output, '&nbsp;<b>∙</b>&#32;')
end

return p
Cookies help us deliver our services. By using our services, you agree to our use of cookies.