aboutsummaryrefslogtreecommitdiff
path: root/shell
diff options
context:
space:
mode:
authorJulien Lavergne <gilir@ubuntu.com>2013-01-05 16:18:38 +0100
committerLeandro Pereira <leandro@hardinfo.org>2014-01-03 08:02:30 -0200
commiteb77158796dbf5f3ce395f5b85a2d0f78038fa00 (patch)
treefd3e5bc8281922378b388020f662871aeb60d805 /shell
parentba24b32ccaaf44f683ffe35cd4ac4ddf61c8da06 (diff)
Add initial translation support (patch from rodin.s)
Diffstat (limited to 'shell')
-rw-r--r--shell/callbacks.c62
-rw-r--r--shell/loadgraph.c2
-rw-r--r--shell/menu.c59
-rw-r--r--shell/report.c24
-rw-r--r--shell/shell.c20
-rw-r--r--shell/syncmanager.c42
6 files changed, 107 insertions, 102 deletions
diff --git a/shell/callbacks.c b/shell/callbacks.c
index 16211995..2bfb73b5 100644
--- a/shell/callbacks.c
+++ b/shell/callbacks.c
@@ -68,7 +68,7 @@ void cb_connect_host(GtkAction * action)
if (remote_connect_host(name)) {
gchar *tmp;
- tmp = g_strdup_printf("Remote: <b>%s</b>", name);
+ tmp = g_strdup_printf(_("Remote: <b>%s</b>"), name);
shell_set_remote_label(shell, tmp);
g_free(tmp);
@@ -114,20 +114,20 @@ void cb_local_computer()
#ifdef HAS_LIBSOUP
Shell *shell = shell_get_main_shell();
- shell_status_update("Disconnecting...");
+ shell_status_update(_("Disconnecting..."));
remote_disconnect_all(TRUE);
- shell_status_update("Unloading modules...");
+ shell_status_update(_("Unloading modules..."));
module_unload_all();
- shell_status_update("Loading local modules...");
+ shell_status_update(_("Loading local modules..."));
shell->tree->modules = modules_load_all();
g_slist_foreach(shell->tree->modules, shell_add_modules_to_gui, shell->tree);
gtk_tree_view_expand_all(GTK_TREE_VIEW(shell->tree->view));
shell_view_set_enabled(TRUE);
- shell_status_update("Done.");
+ shell_status_update(_("Done."));
shell_set_remote_label(shell, "");
#endif /* HAS_LIBSOUP */
}
@@ -139,7 +139,7 @@ void cb_save_graphic()
gchar *filename;
/* save the pixbuf to a png file */
- dialog = gtk_file_chooser_dialog_new("Save Image",
+ dialog = gtk_file_chooser_dialog_new(_("Save Image"),
NULL,
GTK_FILE_CHOOSER_ACTION_SAVE,
GTK_STOCK_CANCEL,
@@ -155,11 +155,11 @@ void cb_save_graphic()
filename = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(dialog));
gtk_widget_destroy(dialog);
- shell_status_update("Saving image...");
+ shell_status_update(_("Saving image..."));
tree_view_save_image(filename);
- shell_status_update("Done.");
+ shell_status_update(_("Done."));
g_free(filename);
return;
@@ -233,7 +233,7 @@ no_context_help:
GTK_DIALOG_DESTROY_WITH_PARENT,
GTK_MESSAGE_ERROR,
GTK_BUTTONS_CLOSE,
- "No context help available.");
+ _("No context help available."));
gtk_dialog_run(GTK_DIALOG(dialog));
gtk_widget_destroy(dialog);
@@ -315,14 +315,14 @@ void cb_about_module(GtkAction * action)
about = gtk_about_dialog_new();
- text = g_strdup_printf("%s Module", sm->name);
+ text = g_strdup_printf(_("%s Module"), sm->name);
gtk_about_dialog_set_name(GTK_ABOUT_DIALOG(about), text);
g_free(text);
gtk_about_dialog_set_version(GTK_ABOUT_DIALOG(about),
ma->version);
- text = g_strdup_printf("Written by %s\nLicensed under %s",
+ text = g_strdup_printf(_("Written by %s\nLicensed under %s"),
ma->author, ma->license);
gtk_about_dialog_set_copyright(GTK_ABOUT_DIALOG(about), text);
g_free(text);
@@ -336,7 +336,7 @@ void cb_about_module(GtkAction * action)
gtk_widget_destroy(about);
} else {
g_warning
- ("No about information is associated with the %s module.",
+ (_("No about information is associated with the %s module."),
name);
}
@@ -350,30 +350,30 @@ void cb_about()
{
GtkWidget *about;
const gchar *authors[] = {
- "Author:",
+ _("Author:"),
"Leandro A. F. Pereira",
"",
- "Contributors:",
+ _("Contributors:"),
"Agney Lopes Roth Ferraz",
"Andrey Esin",
"",
- "Based on work by:",
- "MD5 implementation by Colin Plumb (see md5.c for details)",
- "SHA1 implementation by Steve Reid (see sha1.c for details)",
- "Blowfish implementation by Paul Kocher (see blowfich.c for details)",
- "Raytracing benchmark by John Walker (see fbench.c for details)",
- "FFT benchmark by Scott Robert Ladd (see fftbench.c for details)",
- "Some code partly based on x86cpucaps by Osamu Kayasono",
- "Vendor list based on GtkSysInfo by Pissens Sebastien",
- "DMI support based on code by Stewart Adam",
- "SCSI support based on code by Pascal F. Martin",
+ _("Based on work by:"),
+ _("MD5 implementation by Colin Plumb (see md5.c for details)"),
+ _("SHA1 implementation by Steve Reid (see sha1.c for details)"),
+ _("Blowfish implementation by Paul Kocher (see blowfich.c for details)"),
+ _("Raytracing benchmark by John Walker (see fbench.c for details)"),
+ _("FFT benchmark by Scott Robert Ladd (see fftbench.c for details)"),
+ _("Some code partly based on x86cpucaps by Osamu Kayasono"),
+ _("Vendor list based on GtkSysInfo by Pissens Sebastien"),
+ _("DMI support based on code by Stewart Adam"),
+ _("SCSI support based on code by Pascal F. Martin"),
NULL
};
const gchar *artists[] = {
- "Jakub Szypulka",
- "Tango Project",
- "The GNOME Project",
- "VMWare, Inc. (USB icon from VMWare Workstation 6)",
+ _("Jakub Szypulka"),
+ _("Tango Project"),
+ _("The GNOME Project"),
+ _("VMWare, Inc. (USB icon from VMWare Workstation 6)"),
NULL
};
@@ -384,12 +384,12 @@ void cb_about()
"Copyright \302\251 2003-2012 "
"Leandro A. F. Pereira");
gtk_about_dialog_set_comments(GTK_ABOUT_DIALOG(about),
- "System information and benchmark tool");
+ _("System information and benchmark tool"));
gtk_about_dialog_set_logo(GTK_ABOUT_DIALOG(about),
icon_cache_get_pixbuf("logo.png"));
gtk_about_dialog_set_license(GTK_ABOUT_DIALOG(about),
- "HardInfo is free software; you can redistribute it and/or modify "
+ _("HardInfo is free software; you can redistribute it and/or modify "
"it under the terms of the GNU General Public License as published by "
"the Free Software Foundation, version 2.\n\n"
"This program is distributed in the hope that it will be useful, "
@@ -398,7 +398,7 @@ void cb_about()
"GNU General Public License for more details.\n\n"
"You should have received a copy of the GNU General Public License "
"along with this program; if not, write to the Free Software "
- "Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA");
+ "Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA"));
#if GTK_CHECK_VERSION(2,8,0)
gtk_about_dialog_set_wrap_license(GTK_ABOUT_DIALOG(about), TRUE);
#endif
diff --git a/shell/loadgraph.c b/shell/loadgraph.c
index c8503072..22c44dae 100644
--- a/shell/loadgraph.c
+++ b/shell/loadgraph.c
@@ -323,6 +323,8 @@ gboolean lg_update(gpointer d)
int main(int argc, char **argv)
{
+
+
LoadGraph *lg;
GtkWidget *window;
diff --git a/shell/menu.c b/shell/menu.c
index 6b96e271..ddc2f864 100644
--- a/shell/menu.c
+++ b/shell/menu.c
@@ -28,108 +28,109 @@
#include <callbacks.h>
#include <hardinfo.h>
+
#include "uidefs.h"
static GtkActionEntry entries[] = {
- {"InformationMenuAction", NULL, "_Information"}, /* name, stock id, label */
- {"RemoteMenuAction", NULL, "_Remote"},
- {"ViewMenuAction", NULL, "_View"},
- {"HelpMenuAction", NULL, "_Help"},
- {"HelpMenuModulesAction", HI_STOCK_ABOUT_MODULES, "About _Modules"},
+ {"InformationMenuAction", NULL, N_("_Information")}, /* name, stock id, label */
+ {"RemoteMenuAction", NULL, N_("_Remote")},
+ {"ViewMenuAction", NULL, N_("_View")},
+ {"HelpMenuAction", NULL, N_("_Help")},
+ {"HelpMenuModulesAction", HI_STOCK_ABOUT_MODULES, N_("About _Modules")},
{"MainMenuBarAction", NULL, ""},
{"ReportAction", HI_STOCK_REPORT, /* name, stock id */
- "Generate _Report", "<control>R", /* label, accelerator */
+ N_("Generate _Report"), "<control>R", /* label, accelerator */
NULL, /* tooltip */
G_CALLBACK(cb_generate_report)},
{"SyncManagerAction", HI_STOCK_SYNC_MENU,
- "_Network Updater...", NULL,
+ N_("_Network Updater..."), NULL,
NULL,
G_CALLBACK(cb_sync_manager)},
{"OpenAction", GTK_STOCK_OPEN,
- "_Open...", NULL,
+ N_("_Open..."), NULL,
NULL,
G_CALLBACK(cb_sync_manager)},
{"ConnectToAction", GTK_STOCK_CONNECT,
- "_Connect to...", NULL,
+ N_("_Connect to..."), NULL,
NULL,
G_CALLBACK(cb_connect_to)},
{"ManageAction", NULL,
- "_Manage hosts...", NULL,
+ N_("_Manage hosts..."), NULL,
NULL,
G_CALLBACK(cb_manage_hosts)},
{"LocalComputerAction", GTK_STOCK_HOME,
- "_Local computer", NULL,
+ N_("_Local computer"), NULL,
NULL,
G_CALLBACK(cb_local_computer)},
{"CopyAction", GTK_STOCK_COPY,
- "_Copy to Clipboard", "<control>C",
- "Copy to clipboard",
+ N_("_Copy to Clipboard"), "<control>C",
+ N_("Copy to clipboard"),
G_CALLBACK(cb_copy_to_clipboard)},
{"SaveGraphAction", GTK_STOCK_SAVE_AS,
- "_Save image as...", "<control>S",
+ N_("_Save image as..."), "<control>S",
NULL,
G_CALLBACK(cb_save_graphic)},
{"RefreshAction", GTK_STOCK_REFRESH,
- "_Refresh", "F5",
+ N_("_Refresh"), "F5",
NULL,
G_CALLBACK(cb_refresh)},
{"OnlineDocsAction", GTK_STOCK_HELP,
- "Contents", "F1",
+ N_("Contents"), "F1",
NULL,
G_CALLBACK(cb_open_online_docs)},
{"ContextHelpAction", NULL,
- "Context help", "<Ctrl>F1",
+ N_("Context help"), "<Ctrl>F1",
NULL,
G_CALLBACK(cb_open_online_docs_context)},
{"HomePageAction", HI_STOCK_INTERNET,
- "_Open HardInfo Web Site", NULL,
+ N_("_Open HardInfo Web Site"), NULL,
NULL,
G_CALLBACK(cb_open_web_page)},
{"ReportBugAction", HI_STOCK_INTERNET,
- "_Report bug", NULL,
+ N_("_Report bug"), NULL,
NULL,
G_CALLBACK(cb_report_bug)},
{"DonateAction", HI_STOCK_DONATE,
- "_Donate to the project", NULL,
+ N_("_Donate to the project"), NULL,
NULL,
G_CALLBACK(cb_donate)},
{"AboutAction", GTK_STOCK_ABOUT,
- "_About HardInfo", NULL,
- "Displays program version information",
+ N_("_About HardInfo"), NULL,
+ N_("Displays program version information"),
G_CALLBACK(cb_about)},
{"QuitAction", GTK_STOCK_QUIT,
- "_Quit", "<control>Q",
+ N_("_Quit"), "<control>Q",
NULL,
G_CALLBACK(cb_quit)}
};
static GtkToggleActionEntry toggle_entries[] = {
{"SidePaneAction", NULL,
- "_Side Pane", NULL,
- "Toggles side pane visibility",
+ N_("_Side Pane"), NULL,
+ N_("Toggles side pane visibility"),
G_CALLBACK(cb_side_pane)},
{"ToolbarAction", NULL,
- "_Toolbar", NULL,
+ N_("_Toolbar"), NULL,
NULL,
G_CALLBACK(cb_toolbar)},
{"ActAsServerAction", NULL,
- "_Accept connections", NULL,
+ N_("_Accept connections"), NULL,
NULL,
G_CALLBACK(cb_act_as_server) }
};
@@ -163,13 +164,15 @@ void menu_init(Shell * shell)
/* Pack up our objects:
* menu_box -> window
* actions -> action_group
- * action_group -> menu_manager */
+ * action_group -> menu_manager */
+ gtk_action_group_set_translation_domain( action_group, "hardinfo" );//gettext
gtk_action_group_add_actions(action_group, entries,
G_N_ELEMENTS(entries), NULL);
gtk_action_group_add_toggle_actions(action_group, toggle_entries,
G_N_ELEMENTS(toggle_entries),
NULL);
gtk_ui_manager_insert_action_group(menu_manager, action_group, 0);
+
/* Read in the UI from our XML file */
error = NULL;
diff --git a/shell/report.c b/shell/report.c
index 20974de1..241bca67 100644
--- a/shell/report.c
+++ b/shell/report.c
@@ -489,7 +489,7 @@ static gchar *report_get_filename(void)
GtkWidget *dialog;
gchar *filename = NULL;
- dialog = gtk_file_chooser_dialog_new("Save File",
+ dialog = gtk_file_chooser_dialog_new(_("Save File"),
NULL,
GTK_FILE_CHOOSER_ACTION_SAVE,
GTK_STOCK_CANCEL,
@@ -613,7 +613,7 @@ static gboolean report_generate(ReportDialog * rd)
create_context = file_types_get_data_by_name(file_types, file);
if (!create_context) {
- g_warning("Cannot create ReportContext. Programming bug?");
+ g_warning(_("Cannot create ReportContext. Programming bug?"));
g_free(file);
return FALSE;
}
@@ -631,7 +631,7 @@ static gboolean report_generate(ReportDialog * rd)
GTK_DIALOG_DESTROY_WITH_PARENT,
GTK_MESSAGE_QUESTION,
GTK_BUTTONS_NONE,
- "Open the report with your web browser?");
+ _("Open the report with your web browser?"));
gtk_dialog_add_buttons(GTK_DIALOG(dialog),
GTK_STOCK_NO, GTK_RESPONSE_REJECT,
GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT, NULL);
@@ -659,7 +659,7 @@ void report_dialog_show(GtkTreeModel * model, GtkWidget * parent)
ReportDialog *rd = report_dialog_new(model, parent);
if (gtk_dialog_run(GTK_DIALOG(rd->dialog)) == GTK_RESPONSE_ACCEPT) {
- shell_status_update("Generating report...");
+ shell_status_update(_("Generating report..."));
gtk_widget_hide(rd->dialog);
shell_view_set_enabled(FALSE);
shell_status_set_enabled(TRUE);
@@ -669,9 +669,9 @@ void report_dialog_show(GtkTreeModel * model, GtkWidget * parent)
shell_status_set_enabled(FALSE);
if (success)
- shell_status_update("Report saved.");
+ shell_status_update(_("Report saved."));
else
- shell_status_update("Error while creating the report.");
+ shell_status_update(_("Error while creating the report."));
}
set_all_active(rd, FALSE);
@@ -773,7 +773,7 @@ static ReportDialog
rd = g_new0(ReportDialog, 1);
dialog = gtk_dialog_new();
- gtk_window_set_title(GTK_WINDOW(dialog), "Generate Report");
+ gtk_window_set_title(GTK_WINDOW(dialog), _("Generate Report"));
gtk_container_set_border_width(GTK_CONTAINER(dialog), 5);
gtk_window_set_default_size(GTK_WINDOW(dialog), 420, 260);
gtk_window_set_transient_for(GTK_WINDOW(dialog), GTK_WINDOW(parent));
@@ -790,9 +790,9 @@ static ReportDialog
hbox = gtk_hbox_new(FALSE, 5);
gtk_box_pack_start(GTK_BOX(dialog1_vbox), hbox, FALSE, FALSE, 0);
- label = gtk_label_new("<big><b>Generate Report</b></big>\n"
+ label = gtk_label_new(_("<big><b>Generate Report</b></big>\n"
"Please choose the information that you wish "
- "to view in your report:");
+ "to view in your report:"));
gtk_label_set_line_wrap(GTK_LABEL(label), TRUE);
gtk_label_set_use_markup(GTK_LABEL(label), TRUE);
gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.5);
@@ -850,14 +850,14 @@ static ReportDialog
gtk_button_box_set_layout(GTK_BUTTON_BOX(vbuttonbox3),
GTK_BUTTONBOX_START);
- button3 = gtk_button_new_with_mnemonic("Select _None");
+ button3 = gtk_button_new_with_mnemonic(_("Select _None"));
gtk_widget_show(button3);
gtk_container_add(GTK_CONTAINER(vbuttonbox3), button3);
GTK_WIDGET_SET_FLAGS(button3, GTK_CAN_DEFAULT);
g_signal_connect(button3, "clicked",
G_CALLBACK(report_dialog_sel_none), rd);
- button6 = gtk_button_new_with_mnemonic("Select _All");
+ button6 = gtk_button_new_with_mnemonic(_("Select _All"));
gtk_widget_show(button6);
gtk_container_add(GTK_CONTAINER(vbuttonbox3), button6);
GTK_WIDGET_SET_FLAGS(button6, GTK_CAN_DEFAULT);
@@ -875,7 +875,7 @@ static ReportDialog
GTK_RESPONSE_CANCEL);
GTK_WIDGET_SET_FLAGS(button8, GTK_CAN_DEFAULT);
- button7 = gtk_button_new_with_mnemonic("_Generate");
+ button7 = gtk_button_new_with_mnemonic(_("_Generate"));
gtk_widget_show(button7);
gtk_dialog_add_action_widget(GTK_DIALOG(dialog), button7,
GTK_RESPONSE_ACCEPT);
diff --git a/shell/shell.c b/shell/shell.c
index 9d0e88ba..c6add81b 100644
--- a/shell/shell.c
+++ b/shell/shell.c
@@ -311,7 +311,7 @@ void shell_status_set_enabled(gboolean setting)
gtk_widget_hide(shell->progress);
shell_view_set_enabled(TRUE);
- shell_status_update("Done.");
+ shell_status_update(_("Done."));
}
}
@@ -404,12 +404,12 @@ void shell_set_title(Shell *shell, gchar *subtitle)
if (subtitle) {
gchar *tmp;
- tmp = g_strdup_printf("%s - System Information", subtitle);
+ tmp = g_strdup_printf(_("%s - System Information"), subtitle);
gtk_window_set_title(GTK_WINDOW(shell->window), tmp);
g_free(tmp);
} else {
- gtk_window_set_title(GTK_WINDOW(shell->window), "System Information");
+ gtk_window_set_title(GTK_WINDOW(shell->window), _("System Information"));
}
}
@@ -798,7 +798,7 @@ void shell_init(GSList * modules)
gtk_notebook_set_show_border(GTK_NOTEBOOK(shell->notebook), FALSE);
shell_status_set_enabled(TRUE);
- shell_status_update("Loading modules...");
+ shell_status_update(_("Loading modules..."));
shell->tree->modules = modules ? modules : modules_load_all();
@@ -811,7 +811,7 @@ void shell_init(GSList * modules)
gtk_widget_hide(shell->notebook);
gtk_widget_hide(shell->note->event_box);
- shell_status_update("Done.");
+ shell_status_update(_("Done."));
shell_status_set_enabled(FALSE);
shell_action_set_enabled("ContextHelpAction", FALSE);
@@ -1647,7 +1647,7 @@ static void shell_summary_create_header(ShellSummary *summary,
GtkWidget *header, *label;
gchar *temp;
- temp = g_strdup_printf("<b>%s \342\206\222 Summary</b>", title);
+ temp = g_strdup_printf(_("<b>%s \342\206\222 Summary</b>"), title);
header = gtk_menu_item_new_with_label(temp);
gtk_menu_item_select(GTK_MENU_ITEM(header));
@@ -1755,7 +1755,7 @@ static void module_selected(gpointer data)
gchar *title;
shell_status_set_enabled(TRUE);
- shell_status_update("Updating...");
+ shell_status_update(_("Updating..."));
entry->selected = TRUE;
shell->selected = entry;
@@ -1787,13 +1787,13 @@ static void module_selected(gpointer data)
g_free(temp);
} else {
shell_action_set_enabled("ContextHelpAction", FALSE);
- shell_action_set_label("ContextHelpAction", "Context help");
+ shell_action_set_label("ContextHelpAction", _("Context help"));
}
shell_action_set_enabled("RefreshAction", TRUE);
shell_action_set_enabled("CopyAction", TRUE);
- shell_status_update("Done.");
+ shell_status_update(_("Done."));
shell_status_set_enabled(FALSE);
} else {
shell_set_title(shell, NULL);
@@ -1804,7 +1804,7 @@ static void module_selected(gpointer data)
set_view_type(SHELL_VIEW_NORMAL, FALSE);
shell_action_set_enabled("ContextHelpAction", FALSE);
- shell_action_set_label("ContextHelpAction", "Context help");
+ shell_action_set_label("ContextHelpAction", _("Context help"));
if (shell->selected_module->summaryfunc) {
shell_show_summary();
diff --git a/shell/syncmanager.c b/shell/syncmanager.c
index ce50d429..3afd45b7 100644
--- a/shell/syncmanager.c
+++ b/shell/syncmanager.c
@@ -66,11 +66,11 @@ static GQuark err_quark;
#define XMLRPC_SERVER_URI "http://hardinfo.berlios.de/xmlrpc/"
#define XMLRPC_SERVER_API_VERSION 1
-#define LABEL_SYNC_DEFAULT "<big><b>Synchronize with Central Database</b></big>\n" \
+#define LABEL_SYNC_DEFAULT _("<big><b>Synchronize with Central Database</b></big>\n" \
"The following information may be synchronized " \
- "with the HardInfo central database."
-#define LABEL_SYNC_SYNCING "<big><b>Synchronizing</b></big>\n" \
- "This may take some time."
+ "with the HardInfo central database.")
+#define LABEL_SYNC_SYNCING _("<big><b>Synchronizing</b></big>\n" \
+ "This may take some time.")
static SyncDialog *sync_dialog_new(GtkWidget *parent);
static void sync_dialog_destroy(SyncDialog * sd);
@@ -129,7 +129,7 @@ void sync_manager_show(GtkWidget *parent)
{
#ifndef HAS_LIBSOUP
g_warning
- ("HardInfo was compiled without libsoup support. (Network Updater requires it.)");
+ (_("HardInfo was compiled without libsoup support. (Network Updater requires it.)"));
#else /* !HAS_LIBSOUP */
SyncDialog *sd = sync_dialog_new(parent);
@@ -158,7 +158,7 @@ static gint _soup_get_xmlrpc_value_int(SoupMessage * msg,
sna->error = NULL;
if (!SOUP_STATUS_IS_SUCCESSFUL(msg->status_code)) {
- SNA_ERROR(1, "%s (error #%d)", msg->reason_phrase,
+ SNA_ERROR(1, _("%s (error #%d)"), msg->reason_phrase,
msg->status_code);
goto bad;
}
@@ -167,7 +167,7 @@ static gint _soup_get_xmlrpc_value_int(SoupMessage * msg,
msg->response_body->length,
NULL,
G_TYPE_INT, &int_value)) {
- SNA_ERROR(2, "Could not parse XML-RPC response");
+ SNA_ERROR(2, _("Could not parse XML-RPC response"));
}
bad:
@@ -182,7 +182,7 @@ static gchar *_soup_get_xmlrpc_value_string(SoupMessage * msg,
sna->error = NULL;
if (!SOUP_STATUS_IS_SUCCESSFUL(msg->status_code)) {
- SNA_ERROR(1, "%s (error #%d)", msg->reason_phrase,
+ SNA_ERROR(1, _("%s (error #%d)"), msg->reason_phrase,
msg->status_code);
goto bad;
}
@@ -191,7 +191,7 @@ static gchar *_soup_get_xmlrpc_value_string(SoupMessage * msg,
msg->response_body->length,
NULL,
G_TYPE_STRING, &string)) {
- SNA_ERROR(2, "Could not parse XML-RPC response");
+ SNA_ERROR(2, _("Could not parse XML-RPC response"));
}
bad:
@@ -264,9 +264,9 @@ static void _action_check_api_version_got_response(SoupSession * session,
gint version = _soup_get_xmlrpc_value_int(msg, sna);
if (version != XMLRPC_SERVER_API_VERSION) {
- SNA_ERROR(5, "Server says it supports API version %d, but "
+ SNA_ERROR(5, _("Server says it supports API version %d, but "
"this version of HardInfo only supports API "
- "version %d.", version, XMLRPC_SERVER_API_VERSION);
+ "version %d."), version, XMLRPC_SERVER_API_VERSION);
}
g_main_quit(loop);
@@ -359,8 +359,8 @@ static SyncNetAction *sync_manager_get_selected_actions(gint * n)
GSList *entry;
SyncNetAction *actions;
SyncNetAction
- action_check_api = { "Contacting HardInfo Central Database", _action_check_api_version },
- action_clean_up = { "Cleaning up", NULL};
+ action_check_api = { _("Contacting HardInfo Central Database"), _action_check_api_version },
+ action_clean_up = { _("Cleaning up"), NULL};
actions = g_new0(SyncNetAction, 2 + g_slist_length(entries));
@@ -477,7 +477,7 @@ static void sync_dialog_netarea_start_actions(SyncDialog * sd,
if (sd->flag_cancel) {
markup =
- g_strdup_printf("<s>%s</s> <i>(canceled)</i>",
+ g_strdup_printf(_("<s>%s</s> <i>(canceled)</i>"),
sna[i].name);
gtk_label_set_markup(GTK_LABEL(labels[i]), markup);
g_free(markup);
@@ -494,7 +494,7 @@ static void sync_dialog_netarea_start_actions(SyncDialog * sd,
if (sna[i].do_action && !sna[i].do_action(sd, &sna[i])) {
markup =
- g_strdup_printf("<b><s>%s</s></b> <i>(failed)</i>",
+ g_strdup_printf(_("<b><s>%s</s></b> <i>(failed)</i>"),
sna[i].name);
gtk_label_set_markup(GTK_LABEL(labels[i]), markup);
g_free(markup);
@@ -506,18 +506,18 @@ static void sync_dialog_netarea_start_actions(SyncDialog * sd,
if (sna[i].error->code != 1) {
/* the user has not cancelled something... */
g_warning
- ("Failed while performing \"%s\". Please file a bug report "
+ (_("Failed while performing \"%s\". Please file a bug report "
"if this problem persists. (Use the Help\342\206\222Report"
- " bug option.)\n\nDetails: %s", sna[i].name,
+ " bug option.)\n\nDetails: %s"), sna[i].name,
sna[i].error->message);
}
g_error_free(sna[i].error);
} else {
g_warning
- ("Failed while performing \"%s\". Please file a bug report "
+ (_("Failed while performing \"%s\". Please file a bug report "
"if this problem persists. (Use the Help\342\206\222Report"
- " bug option.)", sna[i].name);
+ " bug option.)"), sna[i].name);
}
break;
}
@@ -643,7 +643,7 @@ static SyncDialog *sync_dialog_new(GtkWidget *parent)
dialog = gtk_dialog_new();
gtk_window_set_transient_for(GTK_WINDOW(dialog), GTK_WINDOW(parent));
- gtk_window_set_title(GTK_WINDOW(dialog), "Network Updater");
+ gtk_window_set_title(GTK_WINDOW(dialog), _("Network Updater"));
gtk_window_set_resizable(GTK_WINDOW(dialog), FALSE);
gtk_window_set_icon(GTK_WINDOW(dialog),
icon_cache_get_pixbuf("syncmanager.png"));
@@ -724,7 +724,7 @@ static SyncDialog *sync_dialog_new(GtkWidget *parent)
GTK_RESPONSE_CANCEL);
GTK_WIDGET_SET_FLAGS(button8, GTK_CAN_DEFAULT);
- button7 = gtk_button_new_with_mnemonic("_Synchronize");
+ button7 = gtk_button_new_with_mnemonic(_("_Synchronize"));
gtk_widget_show(button7);
gtk_dialog_add_action_widget(GTK_DIALOG(dialog), button7,
GTK_RESPONSE_ACCEPT);