It would be nice if Scribunto had access to the sorting used eg. in categories. I would imagine something like:
local strings = { ... } table.sort( strings, mw.site.sorter:getCallback() ) -- or mw.language -- strings are now sorted alphabetically
so that each wiki doesn't have to create own ways to hack around eg. numeric sorting.