• Will Thompson's avatar
    driver: Set all categories when changing locale · 3cc1e280
    Will Thompson authored
    Previously, Initial Setup would only change the LC_MESSAGES locale
    category when the user selects a different locale on the language page.
    However, this caused non-ASCII characters to be mangled after switching
    locale. The following test program demonstrates the problem:
    
        #include "config.h"
        #include <locale.h>
        #include <glib.h>
        #include <glib/gi18n-lib.h>
        #include <libgweather/gweather.h>
    
        gint
        main (gint   argc,
              gchar *argv[])
        {
          /* gettext boilerplate */
          setlocale (LC_ALL, "");
          bindtextdomain (GETTEXT_PACKAGE, GNOMELOCALEDIR);
          bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
          textdomain (GETTEXT_PACKAGE);
    
          /* Change locale to Czech */
          locale_t locale = newlocale (LC_MESSAGES_MASK, "cs_CZ.utf8", (locale_t) 0);
          g_assert (locale != (locale_t) 0);
          uselocale (locale);
    
          GWeatherLocation *world = gweather_location_get_world ();
          GWeatherLocation *praha = g...
    3cc1e280