This is the documentation page for Module:LanguageMatrix

This is a "flexible" language matrix based on Module:WikimediaCEETable. The module has multiple functions with different sets of languages so that the entire module doesn't need to be copy-pasted for each use case. Feel free to add new functions!

The current functions are:

  • {{#invoke:LanguageMatrix|Top20|...}} — Top 20 languages by number of speakers
  • {{#invoke:LanguageMatrix|CEE|...}} — Central and Eastern European languages
  • {{#invoke:LanguageMatrix|Nordic|...}} — Nordic languages and languages of neighboring countries; arranged by pageviews
  • {{#invoke:LanguageMatrix|African|...}} — Top 20 African languages, plus European languages spoken in Africa; arranged by pageviews [1]
  • {{#invoke:LanguageMatrix|Celtic|...}} — All 6 Celtic languages

Adding new varieties

edit

To add a new set of languages, you need to create a new function that defines langTable and resultTable. This should look like the following if you want a "generic" header row listing the language codes.

function p.Example(frame)
	langTable = {'en','zh','hi','es','fr','ar','ru','bn','pt','id'}
	resultTable = buildTableHeader(langTable)
	return p.table(frame, langTable, resultTable)
end

If you want a custom header row, for example including flags, you can do that by assigning resultTable directly.