diff options
Diffstat (limited to 'gtk/src/callbacks.c')
-rw-r--r-- | gtk/src/callbacks.c | 139 |
1 files changed, 70 insertions, 69 deletions
diff --git a/gtk/src/callbacks.c b/gtk/src/callbacks.c index 603c23fc4..a6839c42b 100644 --- a/gtk/src/callbacks.c +++ b/gtk/src/callbacks.c @@ -21,6 +21,7 @@ #include <time.h> #include <glib/gstdio.h> +#include <glib/gi18n.h> #include <gio/gio.h> #include "ghbcompat.h" @@ -324,7 +325,7 @@ on_quit1_activate(GtkMenuItem *quit, signal_user_data_t *ud) g_debug("on_quit1_activate ()"); if (state & (GHB_STATE_WORKING|GHB_STATE_SEARCHING)) { - if (ghb_cancel_encode2(ud, "Closing HandBrake will terminate encoding.\n")) + if (ghb_cancel_encode2(ud, _("Closing HandBrake will terminate encoding.\n"))) { ghb_hb_cleanup(FALSE); prune_logs(ud); @@ -772,7 +773,7 @@ update_source_label(signal_user_data_t *ud, const gchar *source, gboolean update } else { - label = "No Title Found"; + label = _("No Title Found"); gtk_label_set_text (GTK_LABEL(widget), label); ghb_settings_set_string(ud->settings, "volume_label", label); return FALSE; @@ -856,7 +857,7 @@ source_dialog_extra_widgets( gtk_combo_box_get_model(GTK_COMBO_BOX(combo)))); link = drives = dvd_device_list(); - gtk_combo_box_text_append_text (combo, "Not Selected"); + gtk_combo_box_text_append_text (combo, _("Not Selected")); while (link != NULL) { gchar *name = get_dvd_device_name(link->data); @@ -883,7 +884,7 @@ show_scan_progress(signal_user_data_t *ud) gtk_widget_show(GTK_WIDGET(progress)); label = GTK_LABEL(GHB_WIDGET(ud->builder, "source_title")); - gtk_label_set_text( label, "Scanning ..." ); + gtk_label_set_text( label, _("Scanning ...") ); } static void @@ -903,8 +904,8 @@ start_scan( widget = GHB_WIDGET(ud->builder, "sourcetoolbutton"); gtk_tool_button_set_icon_name(GTK_TOOL_BUTTON(widget), "hb-stop"); - gtk_tool_button_set_label(GTK_TOOL_BUTTON(widget), "Stop Scan"); - gtk_tool_item_set_tooltip_text(GTK_TOOL_ITEM(widget), "Stop Scan"); + gtk_tool_button_set_label(GTK_TOOL_BUTTON(widget), _("Stop Scan")); + gtk_tool_item_set_tooltip_text(GTK_TOOL_ITEM(widget), _("Stop Scan")); //gtk_widget_set_sensitive(widget, FALSE); action = GHB_ACTION(ud->builder, "source_action"); @@ -1258,7 +1259,7 @@ window_delete_event_cb(GtkWidget *widget, GdkEvent *event, signal_user_data_t *u g_debug("window_delete_event_cb ()"); if (state & (GHB_STATE_WORKING|GHB_STATE_SEARCHING)) { - if (ghb_cancel_encode2(ud, "Closing HandBrake will terminate encoding.\n")) + if (ghb_cancel_encode2(ud, _("Closing HandBrake will terminate encoding.\n"))) { ghb_hb_cleanup(FALSE); prune_logs(ud); @@ -1423,7 +1424,7 @@ show_title_info(signal_user_data_t *ud, hb_title_t *title) } else { - gchar *label = "No Title Found"; + gchar *label = _("No Title Found"); gtk_label_set_text (GTK_LABEL(widget), label); ghb_settings_set_string(ud->settings, "volume_label", label); } @@ -1604,7 +1605,7 @@ set_title_settings(GValue *settings, gint titleindex) } else { - gchar *label = "No Title Found"; + gchar *label = _("No Title Found"); ghb_settings_set_string(settings, "volume_label", label); } } @@ -2160,28 +2161,28 @@ scale_changed_cb(GtkWidget *widget, signal_user_data_t *ud) gchar *text; - text = ghb_settings_get_boolean(ud->settings, "PictureAutoCrop") ? "On" : "Off"; + text = ghb_settings_get_boolean(ud->settings, "PictureAutoCrop") ? _("On") : _("Off"); widget = GHB_WIDGET (ud->builder, "crop_auto"); gtk_label_set_text (GTK_LABEL(widget), text); - text = ghb_settings_get_boolean(ud->settings, "autoscale") ? "On" : "Off"; + text = ghb_settings_get_boolean(ud->settings, "autoscale") ? _("On") : _("Off"); widget = GHB_WIDGET (ud->builder, "scale_auto"); gtk_label_set_text (GTK_LABEL(widget), text); switch (ghb_settings_combo_int(ud->settings, "PicturePAR")) { case 0: - text = "Off"; + text = _("Off"); break; case 1: - text = "Strict"; + text = _("Strict"); break; case 2: - text = "Loose"; + text = _("Loose"); break; case 3: - text = "Custom"; + text = _("Custom"); break; default: - text = "Unknown"; + text = _("Unknown"); break; } widget = GHB_WIDGET (ud->builder, "scale_anamorphic"); @@ -2252,7 +2253,7 @@ quit_cb(countdown_t *cd) gtk_main_quit(); return FALSE; } - str = g_strdup_printf("%s\n\n%s in %d seconds ...", + str = g_strdup_printf(_("%s\n\n%s in %d seconds ..."), cd->msg, cd->action, cd->timeout); gtk_message_dialog_set_markup(cd->dlg, str); g_free(str); @@ -2274,7 +2275,7 @@ shutdown_cb(countdown_t *cd) gtk_main_quit(); return FALSE; } - str = g_strdup_printf("%s\n\n%s in %d seconds ...", + str = g_strdup_printf(_("%s\n\n%s in %d seconds ..."), cd->msg, cd->action, cd->timeout); gtk_message_dialog_set_markup(cd->dlg, str); g_free(str); @@ -2293,7 +2294,7 @@ suspend_cb(countdown_t *cd) ghb_suspend_gpm(); return FALSE; } - str = g_strdup_printf("%s\n\n%s in %d seconds ...", + str = g_strdup_printf(_("%s\n\n%s in %d seconds ..."), cd->msg, cd->action, cd->timeout); gtk_message_dialog_set_markup(cd->dlg, str); g_free(str); @@ -2323,7 +2324,7 @@ ghb_countdown_dialog( // Toss up a warning dialog dialog = gtk_message_dialog_new(NULL, GTK_DIALOG_MODAL, type, GTK_BUTTONS_NONE, - "%s\n\n%s in %d seconds ...", + _("%s\n\n%s in %d seconds ..."), message, action, timeout); gtk_dialog_add_buttons( GTK_DIALOG(dialog), cancel, GTK_RESPONSE_CANCEL, @@ -2392,13 +2393,13 @@ ghb_cancel_encode(signal_user_data_t *ud, const gchar *extra_msg) // Toss up a warning dialog dialog = gtk_message_dialog_new(NULL, GTK_DIALOG_MODAL, GTK_MESSAGE_WARNING, GTK_BUTTONS_NONE, - "%sYour movie will be lost if you don't continue encoding.", + _("%sYour movie will be lost if you don't continue encoding."), extra_msg); gtk_dialog_add_buttons( GTK_DIALOG(dialog), - "Cancel Current and Stop", 1, - "Cancel Current, Start Next", 2, - "Finish Current, then Stop", 3, - "Continue Encoding", 4, + _("Cancel Current and Stop"), 1, + _("Cancel Current, Start Next"), 2, + _("Finish Current, then Stop"), 3, + _("Continue Encoding"), 4, NULL); response = gtk_dialog_run(GTK_DIALOG(dialog)); gtk_widget_destroy (dialog); @@ -2432,11 +2433,11 @@ ghb_cancel_encode2(signal_user_data_t *ud, const gchar *extra_msg) // Toss up a warning dialog dialog = gtk_message_dialog_new(NULL, GTK_DIALOG_MODAL, GTK_MESSAGE_WARNING, GTK_BUTTONS_NONE, - "%sYour movie will be lost if you don't continue encoding.", + _("%sYour movie will be lost if you don't continue encoding."), extra_msg); gtk_dialog_add_buttons( GTK_DIALOG(dialog), - "Cancel Current and Stop", 1, - "Continue Encoding", 4, + _("Cancel Current and Stop"), 1, + _("Continue Encoding"), 4, NULL); response = gtk_dialog_run(GTK_DIALOG(dialog)); gtk_widget_destroy (dialog); @@ -2735,7 +2736,7 @@ working_status_string(signal_user_data_t *ud, ghb_instance_status_t *status) } if (qcount > 1) { - job_str = g_strdup_printf("job %d of %d, ", index+1, qcount); + job_str = g_strdup_printf(_("job %d of %d, "), index+1, qcount); } else { @@ -2745,12 +2746,12 @@ working_status_string(signal_user_data_t *ud, ghb_instance_status_t *status) { if (status->job_cur == 1 && subtitle_scan) { - task_str = g_strdup_printf("pass %d (subtitle scan) of %d, ", + task_str = g_strdup_printf(_("pass %d (subtitle scan) of %d, "), status->job_cur, status->job_count); } else { - task_str = g_strdup_printf("pass %d of %d, ", + task_str = g_strdup_printf(_("pass %d of %d, "), status->job_cur, status->job_count); } } @@ -2763,8 +2764,8 @@ working_status_string(signal_user_data_t *ud, ghb_instance_status_t *status) if (status->rate_cur > 0.0) { status_str= g_strdup_printf( - "Encoding: %s%s%.2f %%" - " (%.2f fps, avg %.2f fps, ETA %02dh%02dm%02ds)", + _("Encoding: %s%s%.2f %%" + " (%.2f fps, avg %.2f fps, ETA %02dh%02dm%02ds)"), job_str, task_str, 100.0 * status->progress, status->rate_cur, status->rate_avg, status->hours, @@ -2773,8 +2774,8 @@ working_status_string(signal_user_data_t *ud, ghb_instance_status_t *status) else { status_str= g_strdup_printf( - "Encoding: %s%s%.2f %%" - " (ETA %02dh%02dm%02ds)", + _("Encoding: %s%s%.2f %%" + " (ETA %02dh%02dm%02ds)"), job_str, task_str, 100.0 * status->progress, status->hours, status->minutes, status->seconds ); @@ -2783,7 +2784,7 @@ working_status_string(signal_user_data_t *ud, ghb_instance_status_t *status) else { status_str= g_strdup_printf( - "Encoding: %s%s%.2f %%", + _("Encoding: %s%s%.2f %%"), job_str, task_str, 100.0 * status->progress ); } @@ -2804,18 +2805,18 @@ searching_status_string(signal_user_data_t *ud, ghb_instance_status_t *status) index = find_queue_job(ud->queue, status->unique_id, &js); if (qcount > 1) { - job_str = g_strdup_printf("job %d of %d, ", index+1, qcount); + job_str = g_strdup_printf(_("job %d of %d, "), index+1, qcount); } else { job_str = g_strdup(""); } - task_str = g_strdup_printf("Searching for start time, "); + task_str = g_strdup_printf(_("Searching for start time, ")); if(status->seconds > -1) { status_str= g_strdup_printf( - "Encoding: %s%s%.2f %%" - " (ETA %02dh%02dm%02ds)", + _("Encoding: %s%s%.2f %%" + " (ETA %02dh%02dm%02ds)"), job_str, task_str, 100.0 * status->progress, status->hours, status->minutes, status->seconds ); @@ -2823,7 +2824,7 @@ searching_status_string(signal_user_data_t *ud, ghb_instance_status_t *status) else { status_str= g_strdup_printf( - "Encoding: %s%s%.2f %%", + _("Encoding: %s%s%.2f %%"), job_str, task_str, 100.0 * status->progress ); } @@ -2882,16 +2883,16 @@ ghb_backend_events(signal_user_data_t *ud) if (status.scan.title_cur == 0) { - status_str = g_strdup ("Scanning..."); + status_str = g_strdup (_("Scanning...")); } else { if (status.scan.preview_cur == 0) - status_str = g_strdup_printf("Scanning title %d of %d...", + status_str = g_strdup_printf(_("Scanning title %d of %d..."), status.scan.title_cur, status.scan.title_count ); else status_str = g_strdup_printf( - "Scanning title %d of %d preview %d...", + _("Scanning title %d of %d preview %d..."), status.scan.title_cur, status.scan.title_count, status.scan.preview_cur); @@ -2914,8 +2915,8 @@ ghb_backend_events(signal_user_data_t *ud) widget = GHB_WIDGET(ud->builder, "sourcetoolbutton"); gtk_tool_button_set_icon_name(GTK_TOOL_BUTTON(widget), "hb-source"); - gtk_tool_button_set_label(GTK_TOOL_BUTTON(widget), "Source"); - gtk_tool_item_set_tooltip_text(GTK_TOOL_ITEM(widget), "Choose Video Source"); + gtk_tool_button_set_label(GTK_TOOL_BUTTON(widget), _("Source")); + gtk_tool_item_set_tooltip_text(GTK_TOOL_ITEM(widget), _("Choose Video Source")); action = GHB_ACTION(ud->builder, "source_action"); gtk_action_set_sensitive(action, TRUE); @@ -2943,7 +2944,7 @@ ghb_backend_events(signal_user_data_t *ud) hb_title_t * title = ghb_get_title_info(titleindex); if (title == NULL) { - gtk_label_set_text(label, "None"); + gtk_label_set_text(label, _("None")); } ghb_clear_scan_state(GHB_STATE_SCANDONE); if (ghb_queue_edit_settings) @@ -2961,7 +2962,7 @@ ghb_backend_events(signal_user_data_t *ud) { // This needs to be in scanning and working since scanning // happens fast enough that it can be missed - gtk_label_set_text (work_status, "Scanning ..."); + gtk_label_set_text (work_status, _("Scanning ...")); gtk_progress_bar_set_fraction (progress, 0); } else if (status.queue.state & GHB_STATE_SCANDONE) @@ -2973,7 +2974,7 @@ ghb_backend_events(signal_user_data_t *ud) } else if (status.queue.state & GHB_STATE_PAUSED) { - gtk_label_set_text (work_status, "Paused"); + gtk_label_set_text (work_status, _("Paused")); } else if (status.queue.state & GHB_STATE_SEARCHING) { @@ -3085,7 +3086,7 @@ ghb_backend_events(signal_user_data_t *ud) switch( status.queue.error ) { case GHB_ERROR_NONE: - gtk_label_set_text (work_status, "Encode Done!"); + gtk_label_set_text (work_status, _("Encode Done!")); qstatus = GHB_QUEUE_DONE; if (js != NULL) { @@ -3099,7 +3100,7 @@ ghb_backend_events(signal_user_data_t *ud) } break; case GHB_ERROR_CANCELED: - gtk_label_set_text (work_status, "Encode Canceled."); + gtk_label_set_text (work_status, _("Encode Canceled.")); qstatus = GHB_QUEUE_CANCELED; if (js != NULL) { @@ -3113,7 +3114,7 @@ ghb_backend_events(signal_user_data_t *ud) } break; default: - gtk_label_set_text (work_status, "Encode Failed."); + gtk_label_set_text (work_status, _("Encode Failed.")); qstatus = GHB_QUEUE_CANCELED; if (js != NULL) { @@ -3159,7 +3160,7 @@ ghb_backend_events(signal_user_data_t *ud) } else if (status.queue.state & GHB_STATE_MUXING) { - gtk_label_set_text (work_status, "Muxing: This may take a while..."); + gtk_label_set_text (work_status, _("Muxing: This may take a while...")); } if (status.scan.state & GHB_STATE_WORKING) @@ -3208,7 +3209,7 @@ status_icon_query_tooltip_cb( else if (status.queue.state & GHB_STATE_SEARCHING) status_str = searching_status_string(ud, &status.queue); else if (status.queue.state & GHB_STATE_WORKDONE) - status_str = g_strdup("Encode Complete"); + status_str = g_strdup(_("Encode Complete")); else status_str = g_strdup("HandBrake"); @@ -4868,7 +4869,7 @@ tweak_setting_cb( { gchar *message; message = g_strdup_printf( - "Invalid Settings:\n%s", + _("Invalid Settings:\n%s"), tweak); ghb_message_dialog(GTK_MESSAGE_ERROR, message, "Cancel", NULL); g_free(message); @@ -4911,7 +4912,7 @@ format_deblock_cb(GtkScale *scale, gdouble val, signal_user_data_t *ud) { if (val < 5.0) { - return g_strdup_printf("Off"); + return g_strdup_printf(_("Off")); } else { @@ -4929,7 +4930,7 @@ format_vquality_cb(GtkScale *scale, gdouble val, signal_user_data_t *ud) { if (val == 0.0) { - return g_strdup_printf("RF: %.4g (Warning: lossless)", val); + return g_strdup_printf(_("RF: %.4g (Warning: lossless)"), val); } else { @@ -4980,7 +4981,7 @@ process_appcast(signal_user_data_t *ud) { goto done; } - msg = g_strdup_printf("HandBrake %s/%s is now available (you have %s/%d).", + msg = g_strdup_printf(_("HandBrake %s/%s is now available (you have %s/%d)."), version, build, hb_get_version(NULL), hb_get_build(NULL)); label = GHB_WIDGET(ud->builder, "update_message"); gtk_label_set_text(GTK_LABEL(label), msg); @@ -5221,8 +5222,8 @@ ghb_notify_done(signal_user_data_t *ud) #if !defined(_WIN32) NotifyNotification *notification; notification = notify_notification_new( - "Encode Complete", - "Put down that cocktail, Your HandBrake queue is done!", + _("Encode Complete"), + _("Put down that cocktail, Your HandBrake queue is done!"), NULL #if NOTIFY_CHECK_VERSION (0, 7, 0) ); @@ -5246,9 +5247,9 @@ ghb_notify_done(signal_user_data_t *ud) if (ghb_can_shutdown_gsm()) { ghb_countdown_dialog(GTK_MESSAGE_WARNING, - "Your encode is complete.", - "Shutting down the computer", - "Cancel", (GSourceFunc)shutdown_cb, ud, 60); + _("Your encode is complete."), + _("Shutting down the computer"), + _("Cancel"), (GSourceFunc)shutdown_cb, ud, 60); } } if (ghb_settings_combo_int(ud->settings, "WhenComplete") == 2) @@ -5256,17 +5257,17 @@ ghb_notify_done(signal_user_data_t *ud) if (ghb_can_suspend_gpm()) { ghb_countdown_dialog(GTK_MESSAGE_WARNING, - "Your encode is complete.", - "Putting computer to sleep", - "Cancel", (GSourceFunc)suspend_cb, ud, 60); + _("Your encode is complete."), + _("Putting computer to sleep"), + _("Cancel"), (GSourceFunc)suspend_cb, ud, 60); } } if (ghb_settings_combo_int(ud->settings, "WhenComplete") == 4) { ghb_countdown_dialog(GTK_MESSAGE_WARNING, - "Your encode is complete.", - "Quiting Handbrake", - "Cancel", (GSourceFunc)quit_cb, ud, 60); + _("Your encode is complete."), + _("Quiting Handbrake"), + _("Cancel"), (GSourceFunc)quit_cb, ud, 60); } } |