Module:Languages/List: Difference between revisions
From Neodyland Wiki
More actions
m Javascript snippet no longer needed (and may be also inaccurate as it returns the list from the javascripts loaded by the client, possibly outdated when read from its browser cache) |
just formatting the list for tests in comments; this module has almost no utility, it does not correctly sort languages by name, only by code, and only those in mw.language (which is also a costly list) |
||
| Line 3: | Line 3: | ||
-- | -- | ||
--[[ Check this list by running this in the console of the Lua Module editor in MediaWiki: | --[[ Check this list by running this in the console of the Lua Module editor in MediaWiki: | ||
="p.list={'" .. table.concat(p.getSortedList(mw.language.fetchLanguageNames()), "','") .. "' | ="p.list = { '" .. table.concat(p.getSortedList(mw.language.fetchLanguageNames()), "', '") .. "' }" | ||
]] | ]] | ||
function p.getSortedList(mwLangList) | function p.getSortedList(mwLangList) | ||
| Line 14: | Line 14: | ||
end | end | ||
-- note that this fetch will be costly if all these languages are loaded individually with their data by Mediawiki | |||
p.list = p.getSortedList(mw.language.fetchLanguageNames()) | p.list = p.getSortedList(mw.language.fetchLanguageNames()) | ||