fixed the bug with getting the wrong locale

getlocale() always returns (None, None) unless setlocale() is used before. (It is supposed to return the active locale, which is none if not selected).

This bug prevents the automatic switching of the language depending on the locale as a fallback option of English is always used instead.

What is probably meant here is getdefaultlocale(), not getlocale().

Just a little change in 1 line.