elementary / switchboard-plug-locale

Switchboard Locale Plug
GNU Lesser General Public License v3.0
11 stars 10 forks source link

Set locale including codeset #142

Closed davidmhewitt closed 3 years ago

davidmhewitt commented 3 years ago

Fixes #143

In many cases we were assembling the locale string to set on the user in accounts service manually. For example, we would get the language code (e.g. en) and the region code (e.g. US) and assemble them together into en_US, in some cases checking that they were exactly 2 characters long. There are some codes that are 3 letters, so this would have caused issues with those locales.

More problematic is that setting en_US or de_DE as a user's AccountsService language on Fedora causes rather big issues with localisation as the AccountsService documentation states it expects the setting to include the codepage (i.e. de_DE.UTF-8). I believe that the Ubuntu version of AccountsService has been patched in some way to prevent those issues from occuring here.

Either way, it's considerably easier if we just stop doing manual assembly of these locale strings and just take them as they come from libgnome-desktop. All locales from there are provided with the language code, region code and codepage in the format de_DE.UTF-8. So lets store those directly in the treestore for our combobox, and use that directly with AccountsService.

To test: