ls | grepis broken in the general case, see https://mywiki.wooledge.org/ParsingLs
You can fix that by doing this line 28 (strictly equivalent to your code, I'm not looking at what you do, only how):
for lang in [a-z][a-z]; do render_lang "$lang"; done
This is not a bashism; glob does support character intervals.
Or, consider using python! http://oremilac.tk/paste/program-design.xhtml
The thing is, it's extremely hard to program (properly) in shell script.
One Python ordered, one Python delivered. Including functional programming influences!