]> spindle.queued.net Git - midori/commitdiff
Distinguish Simplified and Traditional Chinese
authorChristian Dywan <christian@twotoasts.de>
Fri, 11 May 2012 21:48:47 +0000 (23:48 +0200)
committerChristian Dywan <christian@twotoasts.de>
Fri, 11 May 2012 21:48:47 +0000 (23:48 +0200)
midori/midori-browser.c
midori/midori-view.c
midori/midori-websettings.c
midori/midori-websettings.h

index f0852082f05e60de7c6d7ac05671839d4cc60fec..6adfe2cd7c03197481731a525cced45aa8d76ece 100644 (file)
@@ -3407,6 +3407,8 @@ _action_view_encoding_activate (GtkAction*     action,
             const gchar* encoding;
             if (!strcmp (name, "EncodingChinese"))
                 encoding = "BIG5";
+            else if (!strcmp (name, "EncodingChineseSimplified"))
+                encoding = "GB18030";
             else if (!strcmp (name, "EncodingJapanese"))
                 encoding = "SHIFT_JIS";
             else if (!strcmp (name, "EncodingKorean"))
@@ -5458,7 +5460,10 @@ static const GtkRadioActionEntry encoding_entries[] =
         N_("_Automatic"), "",
         NULL, 1 },
     { "EncodingChinese", NULL,
-        N_("Chinese (BIG5)"), "",
+        N_("Chinese Traditional (BIG5)"), "",
+        NULL, 1 },
+    { "EncodingChineseSimplified", NULL,
+        N_("Chinese Simplified (GB18030)"), "",
         NULL, 1 },
     { "EncodingJapanese", NULL,
         /* i18n: A double underscore "__" is used to prevent the mnemonic */
@@ -5630,6 +5635,7 @@ static const gchar* ui_markup =
                 "<menu action='Encoding'>"
                     "<menuitem action='EncodingAutomatic'/>"
                     "<menuitem action='EncodingChinese'/>"
+                    "<menuitem action='EncodingChineseSimplified'/>"
                     "<menuitem action='EncodingJapanese'/>"
                     "<menuitem action='EncodingKorean'/>"
                     "<menuitem action='EncodingRussian'/>"
index 2d848e33adf3348a40fb90d676f330195951a6a9..af80d085c1372041b98ab2be6190159fb467a222 100644 (file)
@@ -2677,6 +2677,7 @@ midori_view_populate_popup (MidoriView* view,
             static const GtkActionEntry encodings[] = {
               { "EncodingAutomatic" },
               { "EncodingChinese" },
+              { "EncodingChineseSimplified" },
               { "EncodingJapanese" },
               { "EncodingKorean" },
               { "EncodingRussian" },
index bc4667932f2e574b2d81841e7b6c1cbbbc7c0fa3..11dc999f9a73352ae9e17c4fc8e5398e6918070b 100644 (file)
@@ -233,7 +233,8 @@ midori_preferred_encoding_get_type (void)
     if (!type)
     {
         static const GEnumValue values[] = {
-         { MIDORI_ENCODING_CHINESE, "MIDORI_ENCODING_CHINESE", N_("Chinese (BIG5)") },
+         { MIDORI_ENCODING_CHINESE, "MIDORI_ENCODING_CHINESE", N_("Chinese Traditional (BIG5)") },
+         { MIDORI_ENCODING_CHINESE_SIMPLIFIED, "MIDORI_ENCODING_CHINESE_SIMPLIFIED", N_("Chinese Simplified (GB18030)") },
          { MIDORI_ENCODING_JAPANESE, "MIDORI_ENCODING_JAPANESE", N_("Japanese (SHIFT_JIS)") },
          { MIDORI_ENCODING_KOREAN, "MIDORI_ENCODING_KOREAN", N_("Korean (EUC-KR)") },
          { MIDORI_ENCODING_RUSSIAN, "MIDORI_ENCODING_RUSSIAN", N_("Russian (KOI8-R)") },
@@ -1188,6 +1189,8 @@ notify_default_encoding_cb (GObject*    object,
     encoding = string ? string : "";
     if (!strcmp (encoding, "BIG5"))
         web_settings->preferred_encoding = MIDORI_ENCODING_CHINESE;
+    else if (!strcmp (encoding, "GB18030"))
+        web_settings->preferred_encoding = MIDORI_ENCODING_CHINESE_SIMPLIFIED;
     else if (!strcmp (encoding, "SHIFT_JIS"))
         web_settings->preferred_encoding = MIDORI_ENCODING_JAPANESE;
     else if (!strcmp (encoding, "EUC-KR"))
@@ -1552,6 +1555,9 @@ midori_web_settings_set_property (GObject*      object,
         case MIDORI_ENCODING_CHINESE:
             g_object_set (object, "default-encoding", "BIG5", NULL);
             break;
+        case MIDORI_ENCODING_CHINESE_SIMPLIFIED:
+            g_object_set (object, "default-encoding", "GB18030", NULL);
+            break;
         case MIDORI_ENCODING_JAPANESE:
             g_object_set (object, "default-encoding", "SHIFT_JIS", NULL);
             break;
index f73a2b828b689f3953107988719aa502cc201b0c..08dc876eeed0becabcc4e5d3898282e4cb7b308a 100644 (file)
@@ -80,7 +80,8 @@ midori_startup_get_type (void) G_GNUC_CONST;
 
 typedef enum
 {
-    MIDORI_ENCODING_CHINESE,
+    MIDORI_ENCODING_CHINESE /* Traditional */,
+    MIDORI_ENCODING_CHINESE_SIMPLIFIED,
     MIDORI_ENCODING_JAPANESE,
     MIDORI_ENCODING_KOREAN,
     MIDORI_ENCODING_RUSSIAN,