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:Languages/List: Difference between revisions

From Neodyland Wiki
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())


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