Indeed, they are sorted on directory name. Be sure to change it either for all languages, or only the current one:
Code:
lang=`grep "language" /var/er_registry.txt |cut -d'=' -f 2 |cut -d'_' -f 1`
Oh and you should probably access it via the /var/mode/ symlink