From dbcfce4197f2051df34edd76f34837db1294e7f5 Mon Sep 17 00:00:00 2001 From: Christian Dywan Date: Mon, 3 Nov 2008 00:17:43 +0100 Subject: [PATCH] Improve strings for the sake of better localization --- midori/main.c | 26 ++++++++++++-------------- midori/midori-browser.c | 28 ++++++++++++++++------------ midori/midori-preferences.c | 14 +++++++++----- midori/midori-stock.h | 2 -- 4 files changed, 37 insertions(+), 33 deletions(-) diff --git a/midori/main.c b/midori/main.c index e15adf84..d5735b98 100644 --- a/midori/main.c +++ b/midori/main.c @@ -75,8 +75,6 @@ stock_items_init (void) { STOCK_EXTENSIONS, N_("_Extensions"), 0, 0, GTK_STOCK_CONVERT }, { STOCK_HISTORY, N_("_History"), 0, 0, GTK_STOCK_SORT_ASCENDING }, { STOCK_HOMEPAGE, N_("_Homepage"), 0, 0, GTK_STOCK_HOME }, - { STOCK_OPEN_IN_TAB, N_("Open in New _Tab"), 0, 0, GTK_STOCK_ADD }, - { STOCK_OPEN_IN_WINDOW, N_("Open in New _Window"), 0, 0, GTK_STOCK_ADD }, { STOCK_PAGE_HOLDER, N_("_Pageholder"), 0, 0, GTK_STOCK_ORIENTATION_PORTRAIT }, { STOCK_SCRIPTS, N_("_Userscripts"), 0, 0, GTK_STOCK_EXECUTE }, { STOCK_STYLES, N_("User_styles"), 0, 0, GTK_STOCK_SELECT_COLOR }, @@ -133,7 +131,7 @@ settings_new_from_file (const gchar* filename) G_KEY_FILE_KEEP_COMMENTS, &error)) { if (error->code != G_FILE_ERROR_NOENT) - printf (_("The configuration couldn't be loaded. %s\n"), + printf (_("The configuration couldn't be loaded: %s\n"), error->message); g_error_free (error); } @@ -591,7 +589,7 @@ db_open (const char* dbname, { *error = g_error_new (MIDORI_HISTORY_ERROR, MIDORI_HISTORY_ERROR_DB_OPEN, - _("Error opening database: %s\n"), + _("Failed to open database: %s\n"), sqlite3_errmsg (db)); } sqlite3_close (db); @@ -623,7 +621,7 @@ db_exec_callback (sqlite3* db, { *error = g_error_new (MIDORI_HISTORY_ERROR, MIDORI_HISTORY_ERROR_EXEC_SQL, - _("Error opening database: %s\n"), + _("Failed to open database: %s\n"), errmsg); } sqlite3_free (errmsg); @@ -678,7 +676,7 @@ midori_history_remove_item_cb (KatzeArray* history, success = db_exec (db, sqlcmd, &error); if (!success) { - g_printerr (_("Failed to remove history item. %s\n"), error->message); + g_printerr (_("Failed to remove history item: %s\n"), error->message); g_error_free (error); return ; } @@ -702,7 +700,7 @@ midori_history_clear_cb (KatzeArray* history, if (!db_exec (db, "DELETE FROM history", &error)) { - g_printerr (_("Failed to clear history. %s\n"), error->message); + g_printerr (_("Failed to clear history: %s\n"), error->message); g_error_free (error); } } @@ -735,7 +733,7 @@ midori_history_add_item_cb (KatzeArray* array, if (!db_exec_callback (db, "SELECT date('now')", gettimestr, item, &error)) { - g_printerr (_("Failed to add history item. %s\n"), error->message); + g_printerr (_("Failed to add history item: %s\n"), error->message); g_error_free (error); return; } @@ -750,7 +748,7 @@ midori_history_add_item_cb (KatzeArray* array, g_free (sqlcmd); if (!success) { - g_printerr (_("Failed to add history item. %s\n"), error->message); + g_printerr (_("Failed to add history item: %s\n"), error->message); g_error_free (error); return ; } @@ -867,7 +865,7 @@ midori_history_terminate (sqlite3* db, db_exec (db, sqlcmd, &error); if (!success) { - g_printerr (_("Failed to remove old history items. %s\n"), error->message); + g_printerr (_("Failed to remove old history items: %s\n"), error->message); g_error_free (error); return ; } @@ -1193,7 +1191,7 @@ main (int argc, { if (error->code != G_FILE_ERROR_NOENT) g_string_append_printf (error_messages, - _("The bookmarks couldn't be loaded. %s\n"), error->message); + _("The bookmarks couldn't be loaded: %s\n"), error->message); g_error_free (error); } g_free (config_file); @@ -1207,7 +1205,7 @@ main (int argc, { if (error->code != G_FILE_ERROR_NOENT) g_string_append_printf (error_messages, - _("The session couldn't be loaded. %s\n"), error->message); + _("The session couldn't be loaded: %s\n"), error->message); g_error_free (error); } g_free (config_file); @@ -1219,7 +1217,7 @@ main (int argc, { if (error->code != G_FILE_ERROR_NOENT) g_string_append_printf (error_messages, - _("The trash couldn't be loaded. %s\n"), error->message); + _("The trash couldn't be loaded: %s\n"), error->message); g_error_free (error); } g_free (config_file); @@ -1232,7 +1230,7 @@ main (int argc, if ((db = midori_history_initialize (history, config_file, &error)) == NULL) { g_string_append_printf (error_messages, - _("The history couldn't be loaded. %s\n"), error->message); + _("The history couldn't be loaded: %s\n"), error->message); g_error_free (error); } g_free (config_file); diff --git a/midori/midori-browser.c b/midori/midori-browser.c index f329d548..59e3c9e9 100644 --- a/midori/midori-browser.c +++ b/midori/midori-browser.c @@ -1145,7 +1145,7 @@ _action_open_activate (GtkAction* action, GtkWidget* dialog; dialog = gtk_file_chooser_dialog_new ( - ("Open file"), GTK_WINDOW (browser), + _("Open file"), GTK_WINDOW (browser), GTK_FILE_CHOOSER_ACTION_OPEN, GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT, @@ -1221,7 +1221,7 @@ _action_save_as_activate (GtkAction* action, gchar* folder; dialog = gtk_file_chooser_dialog_new ( - ("Save file as"), GTK_WINDOW (browser), + _("Save file as"), GTK_WINDOW (browser), GTK_FILE_CHOOSER_ACTION_SAVE, GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, GTK_STOCK_SAVE, GTK_RESPONSE_ACCEPT, @@ -2165,6 +2165,7 @@ midori_panel_bookmarks_cursor_or_row_changed_cb (GtkTreeView* tree_view, static void midori_browser_bookmark_popup_item (GtkWidget* menu, const gchar* stock_id, + const gchar* label, KatzeItem* item, gpointer callback, MidoriBrowser* browser) @@ -2175,6 +2176,9 @@ midori_browser_bookmark_popup_item (GtkWidget* menu, uri = katze_item_get_uri (item); menuitem = gtk_image_menu_item_new_from_stock (stock_id, NULL); + if (label) + gtk_label_set_text_with_mnemonic (GTK_LABEL (gtk_bin_get_child ( + GTK_BIN (menuitem))), label); if (!strcmp (stock_id, GTK_STOCK_EDIT)) gtk_widget_set_sensitive (menuitem, KATZE_IS_ARRAY (item) || uri != NULL); @@ -2292,22 +2296,22 @@ midori_browser_bookmark_popup (GtkWidget* widget, GtkWidget* menuitem; menu = gtk_menu_new (); - midori_browser_bookmark_popup_item (menu, GTK_STOCK_OPEN, + midori_browser_bookmark_popup_item (menu, GTK_STOCK_OPEN, NULL, item, midori_browser_bookmark_open_activate_cb, browser); - midori_browser_bookmark_popup_item (menu, STOCK_OPEN_IN_TAB, + midori_browser_bookmark_popup_item (menu, STOCK_TAB_NEW, _("Open in New _Tab"), item, midori_browser_bookmark_open_in_tab_activate_cb, browser); - midori_browser_bookmark_popup_item (menu, STOCK_OPEN_IN_WINDOW, + midori_browser_bookmark_popup_item (menu, STOCK_WINDOW_NEW, _("Open in New _Window"), item, midori_browser_bookmark_open_in_window_activate_cb, browser); if (history_item && !KATZE_IS_ARRAY (item)) - midori_browser_bookmark_popup_item (menu, STOCK_BOOKMARK_ADD, + midori_browser_bookmark_popup_item (menu, STOCK_BOOKMARK_ADD, NULL, item, midori_browser_bookmark_bookmark_activate_cb, browser); menuitem = gtk_separator_menu_item_new (); gtk_menu_shell_append (GTK_MENU_SHELL (menu), menuitem); gtk_widget_show (menuitem); if (!history_item) - midori_browser_bookmark_popup_item (menu, GTK_STOCK_EDIT, + midori_browser_bookmark_popup_item (menu, GTK_STOCK_EDIT, NULL, item, midori_browser_bookmark_edit_activate_cb, browser); - midori_browser_bookmark_popup_item (menu, GTK_STOCK_DELETE, + midori_browser_bookmark_popup_item (menu, GTK_STOCK_DELETE, NULL, item, midori_browser_bookmark_delete_activate_cb, browser); sokoke_widget_popup (widget, GTK_MENU (menu), @@ -3132,7 +3136,7 @@ static const GtkActionEntry entries[] = { N_("Clear the entire history"), G_CALLBACK (_action_history_clear_activate) }, { "HistoryAddBookmark", STOCK_BOOKMARK_ADD, NULL, "", - N_("Add the selected history item as a bookmark"), + N_("Bookmark the selected history item"), G_CALLBACK (_action_history_add_bookmark_activate) }, { "Tools", NULL, N_("_Tools") }, { "ManageSearchEngines", GTK_STOCK_PROPERTIES, @@ -3516,7 +3520,7 @@ midori_browser_init (MidoriBrowser* browser) "name", "RecentlyVisited", "label", _("_Recently visited pages"), "stock-id", STOCK_HISTORY, - "tooltip", _("Revisit pages that you opened before"), + "tooltip", _("Reopen pages that you visited earlier"), NULL); g_object_connect (action, "signal::populate-popup", @@ -3532,7 +3536,7 @@ midori_browser_init (MidoriBrowser* browser) "name", "Bookmarks", "label", _("_Bookmarks"), "stock-id", STOCK_BOOKMARKS, - "tooltip", _("Reopen a previously closed tab or window"), + "tooltip", _("Show the saved bookmarks"), NULL); g_object_connect (action, "signal::populate-popup", @@ -3546,7 +3550,7 @@ midori_browser_init (MidoriBrowser* browser) action = g_object_new (KATZE_TYPE_ARRAY_ACTION, "name", "Window", - "label", _("Window"), + "label", _("_Window"), "stock-id", GTK_STOCK_INDEX, "tooltip", _("Show a list of all open tabs"), "array", browser->proxy_array, diff --git a/midori/midori-preferences.c b/midori/midori-preferences.c index 3613d147..4a524c2f 100644 --- a/midori/midori-preferences.c +++ b/midori/midori-preferences.c @@ -426,7 +426,7 @@ midori_preferences_set_settings (MidoriPreferences* preferences, #ifdef WEBKIT_CHECK_VERSION #if WEBKIT_CHECK_VERSION (1, 0, 3) button = katze_property_proxy (settings, "enable-developer-extras", NULL); - gtk_button_set_label (GTK_BUTTON (button), _("Developer tools")); + gtk_button_set_label (GTK_BUTTON (button), _("Enable developer tools")); SPANNED_ADD (button, 0, 1, 3, 4); #endif #endif @@ -478,7 +478,8 @@ midori_preferences_set_settings (MidoriPreferences* preferences, WIDGET_ADD (button, 1, 2, 3, 4); /* Page "Network" */ - /*PAGE_NEW (GTK_STOCK_NETWORK, _("Network")); + #if 0 + PAGE_NEW (GTK_STOCK_NETWORK, _("Network")); FRAME_NEW (_("Network")); TABLE_NEW (2, 2); label = katze_property_label (settings, "http-proxy"); @@ -492,11 +493,13 @@ midori_preferences_set_settings (MidoriPreferences* preferences, gtk_box_pack_start (GTK_BOX (hbox), entry, FALSE, FALSE, 0); gtk_box_pack_start (GTK_BOX (hbox), gtk_label_new (_("MB")), FALSE, FALSE, 0); - FILLED_ADD (hbox, 1, 2, 1, 2);*/ + FILLED_ADD (hbox, 1, 2, 1, 2); + #endif /* Page "Privacy" */ PAGE_NEW (GTK_STOCK_INDEX, _("Privacy")); - /*FRAME_NEW (_("Web Cookies")); + #if 0 + FRAME_NEW (_("Web Cookies")); TABLE_NEW (3, 2); label = katze_property_label (settings, "accept-cookies"); INDENTED_ADD (label, 0, 1, 0, 1); @@ -511,7 +514,8 @@ midori_preferences_set_settings (MidoriPreferences* preferences, gtk_box_pack_start (GTK_BOX (hbox), entry, FALSE, FALSE, 0); gtk_box_pack_start (GTK_BOX (hbox), gtk_label_new (_("days")), FALSE, FALSE, 0); - FILLED_ADD (hbox, 1, 2, 2, 3);*/ + FILLED_ADD (hbox, 1, 2, 2, 3); + #endif FRAME_NEW (_("History")); TABLE_NEW (3, 2); button = katze_property_proxy (settings, "remember-last-visited-pages", NULL); diff --git a/midori/midori-stock.h b/midori/midori-stock.h index 9c475003..d1b1d6c9 100644 --- a/midori/midori-stock.h +++ b/midori/midori-stock.h @@ -29,8 +29,6 @@ #define STOCK_PAGE_HOLDER GTK_STOCK_ORIENTATION_PORTRAIT #define STOCK_STYLE "gnome-settings-theme" #define STOCK_STYLES "gnome-settings-theme" -#define STOCK_OPEN_IN_TAB "stock_new-tab" -#define STOCK_OPEN_IN_WINDOW "stock_new-window" #define STOCK_TRANSFER "package" #define STOCK_TRANSFERS "package"