bug-1280: Parse the language code from the locale.

Splitting the string at "_" and lowering the characters.
bug-1280: Handle more different types of "languages":

- zh_CN => zh-cn (in various cases: ZH_cn, zh_cn, ...)
- de => de (what the current GUI produces)
- de_DE => de, en_AU => en, EN_AU => en  (what may be left in the database)
... and more creative upper/lower-cases
bug-1280: Variable naming, formatting, php-syntax-error
Merge branch 'bug-1280' into testserver-stable