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.

Module:Lang links: Difference between revisions

From Neodyland Wiki
No edit summary
No edit summary
Line 34: Line 34:
table.insert(output, '[[' .. subpage .. '|+/−]]')
table.insert(output, '[[' .. subpage .. '|+/−]]')
end
end
return table.concat(output, '&nbsp;<b>∙</b>&#32;')
list = table.concat(output, '&nbsp;<b>∙</b>&#32;')
return '<span class="plainlinks" style="font-size:small;line-height:1.4">'.. list.. '</span>'
end
end


return p
return p

Revision as of 05:10, 24 January 2024

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 70 list.
	local list = {'af', 'als', 'ar', 'az', 'be', 'be-tarask', 'bg', 'bn', 'br', 'ca', 'cs', 
		'cy', 'da', 'de', 'diq', 'el', 'en', 'eo', 'es', 'et', 'eu', 'fa', 'fi', 'fr', 'ga', 
		'gl', 'he', 'hi', 'hr', 'hu', 'hy', 'id', 'it', 'ja', 'ka', 'ko', 'lb', 'lt', 'lv', 
		'mk', 'ml', 'mr', 'ms', 'mt', 'nb', 'nds', 'ne', 'nl', 'nn', 'pl', 'pt', 'pt-br', 
		'ro', 'ru', 'scn', 'sk', 'sk', 'sl', 'sq', 'sr', 'sv', 'ta', 'th', 'tl', 'tr', 'uk', 
		'ur', '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
	list = table.concat(output, '&nbsp;<b>∙</b>&#32;')
	return '<span class="plainlinks" style="font-size:small;line-height:1.4">'.. list.. '</span>'
end

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