http://php.net/manual/en/function.setlocale.php says "Different systems
have different naming schemes for locales." This seems to be true for
platforms (eg Win vs. Linux), but on Debian AFAIR locales were always at
least two-part (de_DE), never just one (de). This seems to have been
broken in 504651a3, likely by mistake.
Also, switch locale immediately, even before writing to the database.
BTW, what happens when system default locale is configured to e.g. fr_FR
and the user selects "English" - does that work?
We now build the dba/supported_locales.sql file from po/locale.values
files for each locale, and we are also fetching the translations from
transifex.net in order to build them.
This commit also adds support for some new locales, especially
Brazilian Portuguese and Mexican Spanish.