[epiphany] bookmark-manager: Store and use localized "Favorites" tag



commit 9308686e38c5deffcdcd6a5e65a85013e381ce1c
Author: Jonathan Kang <jonathankang gnome org>
Date:   Wed Jan 8 14:28:36 2020 +0800

    bookmark-manager: Store and use localized "Favorites" tag
    
    Previously, the unlocalized string "Favorites" is stored and used to
    compare with localized strings, which leads that no bookmark is tagged as
    "Favorites" even if you do so.
    
    Fix that by storing localized "Favorites" string directly and use that
    for populating the bookmark grid.
    
    https://gitlab.gnome.org/GNOME/epiphany/issues/1015

 src/bookmarks/ephy-bookmark-properties-grid.c | 2 +-
 src/bookmarks/ephy-bookmarks-manager.h        | 2 +-
 src/bookmarks/ephy-bookmarks-popover.c        | 8 ++------
 3 files changed, 4 insertions(+), 8 deletions(-)
---
diff --git a/src/bookmarks/ephy-bookmark-properties-grid.c b/src/bookmarks/ephy-bookmark-properties-grid.c
index c96c36bb1..87ddc09d3 100644
--- a/src/bookmarks/ephy-bookmark-properties-grid.c
+++ b/src/bookmarks/ephy-bookmark-properties-grid.c
@@ -185,7 +185,7 @@ ephy_bookmark_properties_grid_create_tag_widget (EphyBookmarkPropertiesGrid *sel
     gtk_box_pack_start (GTK_BOX (box), image, FALSE, FALSE, 0);
   }
 
-  label_text = default_tag ? _(EPHY_BOOKMARKS_FAVORITES_TAG) : tag;
+  label_text = default_tag ? EPHY_BOOKMARKS_FAVORITES_TAG : tag;
   label = gtk_label_new (label_text);
   gtk_box_pack_start (GTK_BOX (box), label, FALSE, FALSE, 0);
 
diff --git a/src/bookmarks/ephy-bookmarks-manager.h b/src/bookmarks/ephy-bookmarks-manager.h
index fa70e8094..685e0c8dc 100644
--- a/src/bookmarks/ephy-bookmarks-manager.h
+++ b/src/bookmarks/ephy-bookmarks-manager.h
@@ -31,7 +31,7 @@ G_BEGIN_DECLS
 
 G_DECLARE_FINAL_TYPE (EphyBookmarksManager, ephy_bookmarks_manager, EPHY, BOOKMARKS_MANAGER, GObject)
 
-#define EPHY_BOOKMARKS_FAVORITES_TAG    N_("Favorites")
+#define EPHY_BOOKMARKS_FAVORITES_TAG    _("Favorites")
 #define EPHY_BOOKMARKS_MOBILE_TAG       N_("Mobile")
 #define FIREFOX_BOOKMARKS_MOBILE_FOLDER "Mobile Bookmarks"
 
diff --git a/src/bookmarks/ephy-bookmarks-popover.c b/src/bookmarks/ephy-bookmarks-popover.c
index e1a321385..8801afe38 100644
--- a/src/bookmarks/ephy-bookmarks-popover.c
+++ b/src/bookmarks/ephy-bookmarks-popover.c
@@ -239,11 +239,10 @@ create_tag_row (const char *tag)
 
   if (g_strcmp0 (tag, EPHY_BOOKMARKS_FAVORITES_TAG) == 0) {
     image = gtk_image_new_from_icon_name ("emblem-favorite-symbolic", GTK_ICON_SIZE_MENU);
-    label = gtk_label_new (_(EPHY_BOOKMARKS_FAVORITES_TAG));
   } else {
     image = gtk_image_new_from_icon_name ("ephy-bookmark-tag-symbolic", GTK_ICON_SIZE_MENU);
-    label = gtk_label_new (tag);
   }
+  label = gtk_label_new (tag);
 
   gtk_box_pack_start (GTK_BOX (box), image, FALSE, FALSE, 0);
   gtk_box_pack_start (GTK_BOX (box), label, TRUE, FALSE, 0);
@@ -410,10 +409,7 @@ ephy_bookmarks_popover_show_tag_detail (EphyBookmarksPopover *self,
     gtk_container_add (GTK_CONTAINER (self->tag_detail_list_box), row);
   }
 
-  if (strcmp (tag, EPHY_BOOKMARKS_FAVORITES_TAG) == 0)
-    gtk_label_set_label (GTK_LABEL (self->tag_detail_label), _(EPHY_BOOKMARKS_FAVORITES_TAG));
-  else
-    gtk_label_set_label (GTK_LABEL (self->tag_detail_label), tag);
+  gtk_label_set_label (GTK_LABEL (self->tag_detail_label), tag);
 
   gtk_stack_set_visible_child_name (GTK_STACK (self->toplevel_stack), "tag_detail");
 


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