From b7e852fe09381e32a017aea85eab3b89f6ddd7b7 Mon Sep 17 00:00:00 2001 From: Christian Dywan Date: Wed, 29 Apr 2009 23:46:41 +0200 Subject: [PATCH] Localize 'Last updated' display of feeds and quote URIs --- extensions/feed-panel/feed-panel.c | 19 ++++++++++++++----- extensions/feed-panel/main.c | 4 ++-- 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/extensions/feed-panel/feed-panel.c b/extensions/feed-panel/feed-panel.c index 167b4039..d8212a8a 100644 --- a/extensions/feed-panel/feed-panel.c +++ b/extensions/feed-panel/feed-panel.c @@ -376,19 +376,28 @@ feed_panel_cursor_or_row_changed_cb (GtkTreeView* treeview, date = katze_item_get_added (item); if (date) { - SoupDate* sdate; + time_t date_t; + const struct tm* tm; + static gchar date_format[512]; const gchar* puri; KatzeItem* parent; - sdate = soup_date_new_from_time_t ((time_t) date); + gchar* last_updated; + date_t = (time_t)date; + tm = localtime (&date_t); + /* Some gcc versions complain about "%c" for no reason */ + strftime (date_format, sizeof (date_format), "%c", tm); parent = katze_item_get_parent (item); g_assert (KATZE_IS_ARRAY (parent)); puri = katze_item_get_uri (parent); + /* i18n: The local date a feed was last updated */ + last_updated = g_strdup_printf (C_("Feed", "Last updated: %s."), + date_format); text = g_strdup_printf ( "feed" - "

%s

Last updated %s.", - puri, soup_date_to_string (sdate, SOUP_DATE_HTTP)); - soup_date_free (sdate); + "

%s

%s", + puri, last_updated); + g_free (last_updated); } } webkit_web_view_load_html_string ( diff --git a/extensions/feed-panel/main.c b/extensions/feed-panel/main.c index 38fba899..d0a13092 100644 --- a/extensions/feed-panel/main.c +++ b/extensions/feed-panel/main.c @@ -111,7 +111,7 @@ feed_add_item (KatzeArray* feeds, NULL, 0, GTK_MESSAGE_ERROR, GTK_BUTTONS_OK, _("Error")); gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dialog), - _("Feed %s already exists"), uri); + _("Feed '%s' already exists"), uri); gtk_window_set_title (GTK_WINDOW (dialog), EXTENSION_NAME); gtk_widget_show (dialog); g_signal_connect_swapped (dialog, "response", @@ -188,7 +188,7 @@ feed_status_cb (KatzeNetRequest* request, { gchar* msg; - msg = g_strdup_printf (_("Error loading feed %s"), + msg = g_strdup_printf (_("Error loading feed '%s'"), katze_item_get_uri (KATZE_ITEM (netpriv->feed))); feed_handle_net_error (netpriv, msg); g_free (msg);