View source for Module:Languages/List
You do not have permission to edit this page, for the following reason:
You can view and copy the source of this page.
local p = {};
local nativeList = require('Module:Multilingual description/sort')
local nativeListIndex = {}
for i, lang in ipairs(nativeList) do
nativeListIndex[lang] = i
end
--
--[[ 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()), "', '") .. "'}"
]]
function p.getSortedList(mwLangList)
local sortedList = {}
for lang, _ in pairs(mwLangList) do
table.insert(sortedList, lang)
end
pcall(function()
table.sort(sortedList, function(lang1, lang2)
return (nativeListIndex[lang1] or -1) <= (nativeListIndex[lang2] or -1)
end)
end)
return sortedList
end
000
1:0
Template used on this page:
Return to Module:Languages/List.