[gnome-control-center] datetime: Fix timezone splitting



commit a5187c3a63c2cef3ea52509f87611b95c690f120
Author: Bastien Nocera <hadess hadess net>
Date:   Fri Dec 10 11:40:04 2010 +0000

    datetime: Fix timezone splitting
    
    Correct the C-version of the UTF-8 characters, so that we don't
    split on spaces as happened with the Italian translations.
    
    Also make sure we remove underscores in both the city and the region
    parts of the timezone name.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=636931

 panels/datetime/cc-datetime-panel.c |   26 +++++++++++++-------------
 1 files changed, 13 insertions(+), 13 deletions(-)
---
diff --git a/panels/datetime/cc-datetime-panel.c b/panels/datetime/cc-datetime-panel.c
index 7f5be76..16337dc 100644
--- a/panels/datetime/cc-datetime-panel.c
+++ b/panels/datetime/cc-datetime-panel.c
@@ -402,30 +402,30 @@ struct get_region_data
 
 /* Slash look-alikes that might be used in translations */
 #define TRANSLATION_SPLIT                                                        \
-        "\x20\x44"        /* FRACTION SLASH */                                   \
-        "\x22\x15"        /* DIVISION SLASH */                                   \
-        "\x29\xF8"        /* BIG SOLIDUS */                                      \
-        "\xFF\x0F"        /* FULLWIDTH SOLIDUS */                                \
+        "\342\201\204"        /* FRACTION SLASH */                               \
+        "\342\210\225"        /* DIVISION SLASH */                               \
+        "\342\247\270"        /* BIG SOLIDUS */                                  \
+        "\357\274\217"        /* FULLWIDTH SOLIDUS */                            \
         "/"
 
 static void
 get_regions (TzLocation             *loc,
              struct get_region_data *data)
 {
+  gchar *zone;
   gchar **split;
   gchar **split_translated;
 
-  split = g_strsplit (loc->zone, "/", 2);
-
-  /* remove underscores */
-  g_strdelimit (split[1], "_", ' ');
+  zone = g_strdup (loc->zone);
+  g_strdelimit (zone, "_", ' ');
+  split = g_strsplit (zone, "/", 2);
+  g_free (zone);
 
   /* Load the translation for it */
-  split_translated = g_strsplit_set (dgettext (GETTEXT_PACKAGE_TIMEZONES, loc->zone),
-                                     TRANSLATION_SPLIT, 2);
-
-  /* remove underscores */
-  g_strdelimit (split_translated[1], "_", ' ');
+  zone = g_strdup (dgettext (GETTEXT_PACKAGE_TIMEZONES, loc->zone));
+  g_strdelimit (zone, "_", ' ');
+  split_translated = g_strsplit_set (zone, TRANSLATION_SPLIT, 2);
+  g_free (zone);
 
   if (!g_hash_table_lookup_extended (data->table, split[0], NULL, NULL))
     {



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]