https://donate.wikimedia.org/wiki/Template:Languages2
It's not too terrible using wikitext, but Lua could probably simplify it a fair bit and clean up the output. Some of the other donatewiki templates are already using Lua, see https://donate.wikimedia.org/wiki/Module:Main