From 84b7af808d8ad60a1571b502babc55f95c173a50 Mon Sep 17 00:00:00 2001 From: Patrick McDermott Date: Mon, 20 Nov 2017 13:07:06 -0500 Subject: MqMainMenu: Internationalize --- diff --git a/src/toolbars/navigation/main-menu.c b/src/toolbars/navigation/main-menu.c index f64cfee..fc857fc 100644 --- a/src/toolbars/navigation/main-menu.c +++ b/src/toolbars/navigation/main-menu.c @@ -27,6 +27,7 @@ #include "../../application.h" #include "../../config/profiles.h" +#include "../../i18n.h" #include "../../notebook.h" #include "../../tab-page.h" #include "../../utils/profile-icon.h" @@ -242,7 +243,7 @@ create_edit_buttons(MqMainMenu *main_menu) "linked"); /* ID, ICON, TOOLTIP */ - NEW_BUTTON(cut, "edit-cut", "Cut"); + NEW_BUTTON(cut, "edit-cut", _("Cut")); gtk_widget_set_sensitive(cut_button, FALSE); webkit_web_view_can_execute_editing_command( WEBKIT_WEB_VIEW(main_menu->web_view), @@ -250,7 +251,7 @@ create_edit_buttons(MqMainMenu *main_menu) NULL, (GAsyncReadyCallback) can_edit_cb, cut_button); /* ID, ICON, TOOLTIP */ - NEW_BUTTON(copy, "edit-copy", "Copy"); + NEW_BUTTON(copy, "edit-copy", _("Copy")); gtk_widget_set_sensitive(copy_button, FALSE); webkit_web_view_can_execute_editing_command( WEBKIT_WEB_VIEW(main_menu->web_view), @@ -258,7 +259,7 @@ create_edit_buttons(MqMainMenu *main_menu) NULL, (GAsyncReadyCallback) can_edit_cb, copy_button); /* ID, ICON, TOOLTIP */ - NEW_BUTTON(paste, "edit-paste", "Paste"); + NEW_BUTTON(paste, "edit-paste", _("Paste")); gtk_widget_set_sensitive(paste_button, FALSE); webkit_web_view_can_execute_editing_command( WEBKIT_WEB_VIEW(main_menu->web_view), @@ -282,9 +283,9 @@ create_zoom_buttons(MqMainMenu *main_menu) "linked"); /* ID, ICON, TOOLTIP */ - NEW_BUTTON(zoom_out, "zoom-out", "Zoom out"); - NEW_BUTTON(zoom_reset, "zoom-original", "Reset zoom"); - NEW_BUTTON(zoom_in, "zoom-in", "Zoom in"); + NEW_BUTTON(zoom_out, "zoom-out", _("Zoom out")); + NEW_BUTTON(zoom_reset, "zoom-original", _("Reset zoom")); + NEW_BUTTON(zoom_in, "zoom-in", _("Zoom in")); return box; } @@ -322,30 +323,30 @@ create_main_grid(MqMainMenu *main_menu) /* Y, X, ID, ICON, LABEL, * TOOLTIP */ - NEW_BTN(0, 0, new_window, "window-new", "New Window", - "Open a new window"); - NEW_BTN(0, 1, find, "edit-find", "Find", - "Find text in this page"); - NEW_BTN(0, 2, fullscreen, "view-fullscreen", "Full Screen", - "Display the window in full screen"); + NEW_BTN(0, 0, new_window, "window-new", _("New Window"), + _("Open a new window"); + NEW_BTN(0, 1, find, "edit-find", _("Find"), + _("Find text in this page"); + NEW_BTN(0, 2, fullscreen, "view-fullscreen", _("Full Screen"), + _("Display the window in full screen")); /* Y, X, ID, ICON, LABEL, * TOOLTIP */ - NEW_BTN(1, 0, open, "document-open", "Open File", - "Open a local file"); - NEW_BTN(1, 1, save, "document-save-as", "Save Page", - "Save this page"); - NEW_BTN(1, 2, email_link, "mail-message-new", "E-mail Link", - "E-mail a link to this page"); + NEW_BTN(1, 0, open, "document-open", _("Open File"), + _("Open a local file"); + NEW_BTN(1, 1, save, "document-save-as", _("Save Page"), + _("Save this page"); + NEW_BTN(1, 2, email_link, "mail-message-new", _("E-mail Link"), + _("E-mail a link to this page")); /* Y, X, ID, ICON, LABEL, * TOOLTIP */ - NEW_BTN(2, 0, print_preview, "document-print-preview", "Print Preview", - "Preview this page"); - NEW_BTN(2, 1, print, "document-print", "Print", - "Print this page"); - NEW_BTN(2, 2, inspector, "preferences-system", "Inspector", - "Open the Web inspector"); + NEW_BTN(2, 0, print_preview, "document-print-preview", _("Print Preview"), + _("Preview this page"); + NEW_BTN(2, 1, print, "document-print", _("Print"), + _("Print this page"); + NEW_BTN(2, 2, inspector, "preferences-system", _("Inspector"), + _("Open the Web inspector")); gtk_widget_set_sensitive(BTN(1, 2), FALSE); /* E-mail link */ gtk_widget_set_sensitive(BTN(2, 0), FALSE); /* Print preview */ @@ -391,7 +392,7 @@ create_profile_buttons(MqMainMenu *main_menu) cur_prof_color = mq_profiles_get_color(profiles, cur_prof); /* ID, ICON, LABEL, TOOLTIP */ - NEW_BUTTON(profile, NULL, cur_prof_name, "Manage profiles"); + NEW_BUTTON(profile, NULL, cur_prof_name, _("Manage profiles")); gtk_button_set_image(GTK_BUTTON(profile_button), gtk_image_new_from_pixbuf( mq_profile_icon_new_pixbuf(cur_prof_color))); @@ -401,7 +402,7 @@ create_profile_buttons(MqMainMenu *main_menu) g_free(cur_prof_color); /* ID, ICON, LABEL, TOOLTIP */ - NEW_BUTTON(preferences, "preferences-desktop", NULL, "Preferences"); + NEW_BUTTON(preferences, "preferences-desktop", NULL, _("Preferences")); /* Set up the grid. */ grid = gtk_grid_new(); @@ -421,9 +422,9 @@ create_application_buttons(MqMainMenu *main_menu) GtkWidget *quit_button; GtkWidget *grid; - /* ID, ICON, LABEL, TOOLTIP */ - NEW_BUTTON(about, "help-about", "About Marquee", "About Marquee"); - NEW_BUTTON(quit, "application-exit", NULL, "Quit"); + /* ID, ICON, LABEL, TOOLTIP */ + NEW_BUTTON(about, "help-about", _("About Marquee"), _("About Marquee")); + NEW_BUTTON(quit, "application-exit", NULL, _("Quit")); /* Set up the grid. */ grid = gtk_grid_new(); @@ -524,22 +525,22 @@ mq_main_menu_class_init(MqMainMenuClass *klass) obj_properties[PROP_TAB_PAGE] = g_param_spec_object( "tab-page", - "MqTabPage", - "The ancestral MqTabPage instance", + P_("MqTabPage"), + P_("The ancestral MqTabPage instance"), MQ_TYPE_TAB_PAGE, G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB); obj_properties[PROP_FIND_TOOLBAR] = g_param_spec_object( "find-toolbar", - "MqFindToolbar", - "The associated MqFindToolbar instance", + P_("MqFindToolbar"), + P_("The associated MqFindToolbar instance"), MQ_TYPE_FIND_TOOLBAR, G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB); obj_properties[PROP_WEB_VIEW] = g_param_spec_object( "web-view", - "MqWebView", - "The associated MqWebView instance", + P_("MqWebView"), + P_("The associated MqWebView instance"), MQ_TYPE_WEB_VIEW, G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB); @@ -553,10 +554,10 @@ mq_main_menu_init(MqMainMenu *main_menu) gtk_tool_button_set_icon_widget(GTK_TOOL_BUTTON(main_menu), gtk_image_new_from_icon_name("open-menu-symbolic", GTK_ICON_SIZE_SMALL_TOOLBAR)); - gtk_tool_button_set_label(GTK_TOOL_BUTTON(main_menu), "Menu"); + gtk_tool_button_set_label(GTK_TOOL_BUTTON(main_menu), _("Menu")); gtk_widget_set_can_focus(gtk_bin_get_child(GTK_BIN(main_menu)), FALSE); - gtk_widget_set_tooltip_text(GTK_WIDGET(main_menu), "Open menu"); + gtk_widget_set_tooltip_text(GTK_WIDGET(main_menu), _("Open menu")); g_signal_connect(main_menu, "clicked", G_CALLBACK(menu_clicked_cb), NULL); } -- cgit v0.9.1