diff options
Diffstat (limited to 'gtk/src')
-rw-r--r-- | gtk/src/audiohandler.c | 11 | ||||
-rw-r--r-- | gtk/src/callbacks.c | 139 | ||||
-rw-r--r-- | gtk/src/hb-backend.c | 283 | ||||
-rw-r--r-- | gtk/src/hb-backend.h | 1 | ||||
-rw-r--r-- | gtk/src/main.c | 20 | ||||
-rw-r--r-- | gtk/src/preview.c | 15 | ||||
-rw-r--r-- | gtk/src/queuehandler.c | 112 |
7 files changed, 270 insertions, 311 deletions
diff --git a/gtk/src/audiohandler.c b/gtk/src/audiohandler.c index c90e67239..cdf1d16e3 100644 --- a/gtk/src/audiohandler.c +++ b/gtk/src/audiohandler.c @@ -11,6 +11,7 @@ * any later version. */ +#include <glib/gi18n.h> #include "ghbcompat.h" #include "hb.h" #include "settings.h" @@ -553,7 +554,7 @@ ghb_audio_list_refresh_selected(signal_user_data_t *ud) drc = ghb_settings_get_double(asettings, "AudioTrackDRCSlider"); if (drc < 1.0) - s_drc = g_strdup("Off"); + s_drc = g_strdup(_("Off")); else s_drc = g_strdup_printf("%.1f", drc); @@ -620,7 +621,7 @@ ghb_audio_list_refresh(signal_user_data_t *ud) drc = ghb_settings_get_double(asettings, "AudioTrackDRCSlider"); if (drc < 1.0) - s_drc = g_strdup("Off"); + s_drc = g_strdup(_("Off")); else s_drc = g_strdup_printf("%.1f", drc); @@ -851,7 +852,7 @@ G_MODULE_EXPORT gchar* format_drc_cb(GtkScale *scale, gdouble val, signal_user_data_t *ud) { if (val < 1.0) - return g_strdup_printf("%-7s", "Off"); + return g_strdup_printf("%-7s", _("Off")); else return g_strdup_printf("%-7.1f", val); } @@ -925,7 +926,7 @@ drc_widget_changed_cb(GtkWidget *widget, gdouble drc, signal_user_data_t *ud) char *s_drc; if (drc < 0.99) - s_drc = g_strdup("Off"); + s_drc = g_strdup(_("Off")); else s_drc = g_strdup_printf("%.1f", drc); ghb_ui_update( ud, "AudioTrackDRCValue", ghb_string_value(s_drc)); @@ -1040,7 +1041,7 @@ ghb_add_audio_to_ui(GtkBuilder *builder, const GValue *settings) drc = ghb_settings_get_double(settings, "AudioTrackDRCSlider"); if (drc < 1.0) - s_drc = g_strdup("Off"); + s_drc = g_strdup(_("Off")); else s_drc = g_strdup_printf("%.1f", drc); 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); } } diff --git a/gtk/src/hb-backend.c b/gtk/src/hb-backend.c index 0787b26ff..ec6379eb2 100644 --- a/gtk/src/hb-backend.c +++ b/gtk/src/hb-backend.c @@ -27,6 +27,7 @@ #include "hb.h" #include "ghbcompat.h" #include <glib/gstdio.h> +#include <glib/gi18n.h> #include "hb-backend.h" #include "settings.h" #include "callbacks.h" @@ -72,9 +73,9 @@ index_str_init(gint max_index) static options_map_t d_point_to_point_opts[] = { - {"Chapters:", "chapter", 0, "0"}, - {"Seconds:", "time", 1, "1"}, - {"Frames:", "frame", 2, "2"}, + {N_("Chapters:"), "chapter", 0, "0"}, + {N_("Seconds:"), "time", 1, "1"}, + {N_("Frames:"), "frame", 2, "2"}, }; combo_opts_t point_to_point_opts = { @@ -84,11 +85,11 @@ combo_opts_t point_to_point_opts = static options_map_t d_when_complete_opts[] = { - {"Do Nothing", "nothing", 0, "0"}, - {"Show Notification", "notify", 1, "1"}, - {"Quit Handbrake", "quit", 4, "4"}, - {"Put Computer To Sleep", "sleep", 2, "2"}, - {"Shutdown Computer", "shutdown", 3, "3"}, + {N_("Do Nothing"), "nothing", 0, "0"}, + {N_("Show Notification"), "notify", 1, "1"}, + {N_("Quit Handbrake"), "quit", 4, "4"}, + {N_("Put Computer To Sleep"), "sleep", 2, "2"}, + {N_("Shutdown Computer"), "shutdown", 3, "3"}, }; combo_opts_t when_complete_opts = { @@ -98,10 +99,10 @@ combo_opts_t when_complete_opts = static options_map_t d_par_opts[] = { - {"Off", "0", 0, "0"}, - {"Strict", "1", 1, "1"}, - {"Loose", "2", 2, "2"}, - {"Custom", "3", 3, "3"}, + {N_("Off"), "0", 0, "0"}, + {N_("Strict"), "1", 1, "1"}, + {N_("Loose"), "2", 2, "2"}, + {N_("Custom"), "3", 3, "3"}, }; combo_opts_t par_opts = { @@ -136,10 +137,10 @@ combo_opts_t logging_opts = static options_map_t d_log_longevity_opts[] = { - {"Week", "week", 7, "7"}, - {"Month", "month", 30, "30"}, - {"Year", "year", 365, "365"}, - {"Immortal", "immortal", 366, "366"}, + {N_("Week"), "week", 7, "7"}, + {N_("Month"), "month", 30, "30"}, + {N_("Year"), "year", 365, "365"}, + {N_("Immortal"), "immortal", 366, "366"}, }; combo_opts_t log_longevity_opts = { @@ -149,10 +150,10 @@ combo_opts_t log_longevity_opts = static options_map_t d_appcast_update_opts[] = { - {"Never", "never", 0, "never"}, - {"Daily", "daily", 1, "daily"}, - {"Weekly", "weekly", 2, "weekly"}, - {"Monthly", "monthly", 3, "monthly"}, + {N_("Never"), "never", 0, "never"}, + {N_("Daily"), "daily", 1, "daily"}, + {N_("Weekly"), "weekly", 2, "weekly"}, + {N_("Monthly"), "monthly", 3, "monthly"}, }; combo_opts_t appcast_update_opts = { @@ -175,9 +176,9 @@ combo_opts_t vqual_granularity_opts = static options_map_t d_detel_opts[] = { - {"Off", "off", 0, ""}, - {"Custom", "custom", 1, ""}, - {"Default","default",2, NULL}, + {N_("Off"), "off", 0, ""}, + {N_("Custom"), "custom", 1, ""}, + {N_("Default"),"default",2, NULL}, }; combo_opts_t detel_opts = { @@ -187,11 +188,11 @@ combo_opts_t detel_opts = static options_map_t d_decomb_opts[] = { - {"Off", "off", 0, ""}, - {"Custom", "custom", 1, ""}, - {"Default","default",2, NULL}, - {"Fast", "fast", 3, "7:2:6:9:1:80"}, - {"Bob", "bob", 4, "455"}, + {N_("Off"), "off", 0, ""}, + {N_("Custom"), "custom", 1, ""}, + {N_("Default"),"default",2, NULL}, + {N_("Fast"), "fast", 3, "7:2:6:9:1:80"}, + {N_("Bob"), "bob", 4, "455"}, }; combo_opts_t decomb_opts = { @@ -201,12 +202,12 @@ combo_opts_t decomb_opts = static options_map_t d_deint_opts[] = { - {"Off", "off", 0, ""}, - {"Custom", "custom", 1, ""}, - {"Fast", "fast", 2, "0:-1:-1:0:1"}, - {"Slow", "slow", 3, "1:-1:-1:0:1"}, - {"Slower", "slower", 4, "3:-1:-1:0:1"}, - {"Bob", "bob", 5, "15:-1:-1:0:1"}, + {N_("Off"), "off", 0, ""}, + {N_("Custom"), "custom", 1, ""}, + {N_("Fast"), "fast", 2, "0:-1:-1:0:1"}, + {N_("Slow"), "slow", 3, "1:-1:-1:0:1"}, + {N_("Slower"), "slower", 4, "3:-1:-1:0:1"}, + {N_("Bob"), "bob", 5, "15:-1:-1:0:1"}, }; combo_opts_t deint_opts = { @@ -216,11 +217,11 @@ combo_opts_t deint_opts = static options_map_t d_denoise_opts[] = { - {"Off", "off", 0, ""}, - {"Custom", "custom", 1, ""}, - {"Weak", "weak", 2, "2:1:2:3"}, - {"Medium", "medium", 3, "3:2:2:3"}, - {"Strong", "strong", 4, "7:7:5:5"}, + {N_("Off"), "off", 0, ""}, + {N_("Custom"), "custom", 1, ""}, + {N_("Weak"), "weak", 2, "2:1:2:3"}, + {N_("Medium"), "medium", 3, "3:2:2:3"}, + {N_("Strong"), "strong", 4, "7:7:5:5"}, }; combo_opts_t denoise_opts = { @@ -230,10 +231,10 @@ combo_opts_t denoise_opts = static options_map_t d_direct_opts[] = { - {"None", "none", 0, "none"}, - {"Spatial", "spatial", 1, "spatial"}, - {"Temporal", "temporal", 2, "temporal"}, - {"Automatic", "auto", 3, "auto"}, + {N_("None"), "none", 0, "none"}, + {N_("Spatial"), "spatial", 1, "spatial"}, + {N_("Temporal"), "temporal", 2, "temporal"}, + {N_("Automatic"), "auto", 3, "auto"}, }; combo_opts_t direct_opts = { @@ -243,9 +244,9 @@ combo_opts_t direct_opts = static options_map_t d_badapt_opts[] = { - {"Off", "0", 0, "0"}, - {"Fast", "1", 1, "1"}, - {"Optimal", "2", 2, "2"}, + {N_("Off"), "0", 0, "0"}, + {N_("Fast"), "1", 1, "1"}, + {N_("Optimal"), "2", 2, "2"}, }; combo_opts_t badapt_opts = { @@ -255,9 +256,9 @@ combo_opts_t badapt_opts = static options_map_t d_bpyramid_opts[] = { - {"Off", "none", 0, "none"}, - {"Strict", "strict", 1, "strict"}, - {"Normal", "normal", 2, "normal"}, + {N_("Off"), "none", 0, "none"}, + {N_("Strict"), "strict", 1, "strict"}, + {N_("Normal"), "normal", 2, "normal"}, }; combo_opts_t bpyramid_opts = { @@ -267,9 +268,9 @@ combo_opts_t bpyramid_opts = static options_map_t d_weightp_opts[] = { - {"Off", "0", 0, "0"}, - {"Simple", "1", 1, "1"}, - {"Smart", "2", 2, "2"}, + {N_("Off"), "0", 0, "0"}, + {N_("Simple"), "1", 1, "1"}, + {N_("Smart"), "2", 2, "2"}, }; combo_opts_t weightp_opts = { @@ -279,11 +280,11 @@ combo_opts_t weightp_opts = static options_map_t d_me_opts[] = { - {"Diamond", "dia", 0, "dia"}, - {"Hexagon", "hex", 1, "hex"}, - {"Uneven Multi-Hexagon", "umh", 2, "umh"}, - {"Exhaustive", "esa", 3, "esa"}, - {"Hadamard Exhaustive", "tesa", 4, "tesa"}, + {N_("Diamond"), "dia", 0, "dia"}, + {N_("Hexagon"), "hex", 1, "hex"}, + {N_("Uneven Multi-Hexagon"), "umh", 2, "umh"}, + {N_("Exhaustive"), "esa", 3, "esa"}, + {N_("Hadamard Exhaustive"), "tesa", 4, "tesa"}, }; combo_opts_t me_opts = { @@ -293,18 +294,18 @@ combo_opts_t me_opts = static options_map_t d_subme_opts[] = { - {"0: SAD, no subpel", "0", 0, "0"}, - {"1: SAD, qpel", "1", 1, "1"}, - {"2: SATD, qpel", "2", 2, "2"}, - {"3: SATD: multi-qpel", "3", 3, "3"}, - {"4: SATD, qpel on all", "4", 4, "4"}, - {"5: SATD, multi-qpel on all", "5", 5, "5"}, - {"6: RD in I/P-frames", "6", 6, "6"}, - {"7: RD in all frames", "7", 7, "7"}, - {"8: RD refine in I/P-frames", "8", 8, "8"}, - {"9: RD refine in all frames", "9", 9, "9"}, - {"10: QPRD in all frames", "10", 10, "10"}, - {"11: No early terminations in analysis", "11", 11, "11"}, + {N_("0: SAD, no subpel"), "0", 0, "0"}, + {N_("1: SAD, qpel"), "1", 1, "1"}, + {N_("2: SATD, qpel"), "2", 2, "2"}, + {N_("3: SATD: multi-qpel"), "3", 3, "3"}, + {N_("4: SATD, qpel on all"), "4", 4, "4"}, + {N_("5: SATD, multi-qpel on all"), "5", 5, "5"}, + {N_("6: RD in I/P-frames"), "6", 6, "6"}, + {N_("7: RD in all frames"), "7", 7, "7"}, + {N_("8: RD refine in I/P-frames"), "8", 8, "8"}, + {N_("9: RD refine in all frames"), "9", 9, "9"}, + {N_("10: QPRD in all frames"), "10", 10, "10"}, + {N_("11: No early terminations in analysis"), "11", 11, "11"}, }; combo_opts_t subme_opts = { @@ -314,11 +315,11 @@ combo_opts_t subme_opts = static options_map_t d_analyse_opts[] = { - {"Most", "p8x8,b8x8,i8x8,i4x4", 0, "p8x8,b8x8,i8x8,i4x4"}, - {"None", "none", 1, "none"}, - {"Some", "i4x4,i8x8", 2, "i4x4,i8x8"}, - {"All", "all", 3, "all"}, - {"Custom", "custom", 4, "all"}, + {N_("Most"), "p8x8,b8x8,i8x8,i4x4", 0, "p8x8,b8x8,i8x8,i4x4"}, + {N_("None"), "none", 1, "none"}, + {N_("Some"), "i4x4,i8x8", 2, "i4x4,i8x8"}, + {N_("All"), "all", 3, "all"}, + {N_("Custom"), "custom", 4, "all"}, }; combo_opts_t analyse_opts = { @@ -328,9 +329,9 @@ combo_opts_t analyse_opts = static options_map_t d_trellis_opts[] = { - {"Off", "0", 0, "0"}, - {"Encode only", "1", 1, "1"}, - {"Always", "2", 2, "2"}, + {N_("Off"), "0", 0, "0"}, + {N_("Encode only"), "1", 1, "1"}, + {N_("Always"), "2", 2, "2"}, }; combo_opts_t trellis_opts = { @@ -1408,44 +1409,6 @@ ghb_subtitle_track_source(GValue *settings, gint track) return VOBSUB; } -const char* -ghb_subtitle_track_source_name(GValue *settings, gint track) -{ - gint titleindex; - const gchar * name = "Unknown"; - - if (track == -2) - { - name = "SRT"; - goto done; - } - if (track == -1) - { - name = "Bitmap"; - goto done; - } - - titleindex = ghb_settings_combo_int(settings, "title"); - if (titleindex < 0) - goto done; - - hb_title_t * title; - hb_subtitle_t * sub; - - title = ghb_get_title_info( titleindex ); - if (title == NULL) - goto done; - - sub = hb_list_item( title->list_subtitle, track); - if (sub != NULL) - { - name = hb_subsource_name(sub->source); - } - -done: - return name; -} - const gchar* ghb_subtitle_track_lang(GValue *settings, gint track) { @@ -1715,13 +1678,15 @@ audio_samplerate_opts_set(GtkBuilder *builder, const gchar *name) gtk_list_store_clear(store); // Add an item for "Same As Source" gtk_list_store_append(store, &iter); + str = g_strdup_printf("<small>%s</small>", _("Same as source")); gtk_list_store_set(store, &iter, - 0, "<small>Same as source</small>", + 0, str, 1, TRUE, 2, "source", 3, 0.0, 4, "source", -1); + g_free(str); const hb_rate_t *rate; for (rate = hb_audio_samplerate_get_next(NULL); rate != NULL; @@ -1752,7 +1717,7 @@ video_framerate_opts_set(GtkBuilder *builder, const gchar *name) // Add an item for "Same As Source" gtk_list_store_append(store, &iter); gtk_list_store_set(store, &iter, - 0, "Same as source", + 0, _("Same as source"), 1, TRUE, 2, "source", 3, 0.0, @@ -1767,15 +1732,15 @@ video_framerate_opts_set(GtkBuilder *builder, const gchar *name) gchar *option; if (strcmp(rate->name, "23.976") == 0) { - desc = "(NTSC Film)"; + desc = _("(NTSC Film)"); } else if (strcmp(rate->name, "25") == 0) { - desc = "(PAL Film/Video)"; + desc = _("(PAL Film/Video)"); } else if (strcmp(rate->name, "29.97") == 0) { - desc = "(NTSC Video)"; + desc = _("(NTSC Video)"); } option = g_strdup_printf ("%s %s", rate->name, desc); gtk_list_store_append(store, &iter); @@ -2019,7 +1984,7 @@ title_opts_set(GtkBuilder *builder, const gchar *name) // No titles. Fill in a default. gtk_list_store_append(store, &iter); gtk_list_store_set(store, &iter, - 0, "No Titles", + 0, _("No Titles"), 1, TRUE, 2, "none", 3, -1.0, @@ -2114,7 +2079,7 @@ x264_tune_opts_set(GtkBuilder *builder, const gchar *name) gtk_list_store_append(store, &iter); gtk_list_store_set(store, &iter, - 0, "None", + 0, _("None"), 1, TRUE, 2, "none", 3, (gdouble)0, @@ -2263,13 +2228,15 @@ audio_track_opts_set(GtkBuilder *builder, const gchar *name, gint titleindex) { // No audio. set some default gtk_list_store_append(store, &iter); + str = g_strdup_printf("<small>%s</small>", _("No Audio")); gtk_list_store_set(store, &iter, - 0, "<small>No Audio</small>", + 0, str, 1, TRUE, 2, "none", 3, -1.0, 4, "none", -1); + g_free(str); audio_track_opts.map[0].option = g_strdup("No Audio"); audio_track_opts.map[0].shortOpt = "none"; audio_track_opts.map[0].ivalue = -1; @@ -2351,7 +2318,7 @@ subtitle_track_opts_set(GtkBuilder *builder, const gchar *name, gint titleindex) } gtk_list_store_append(store, &iter); gtk_list_store_set(store, &iter, - 0, "Foreign Audio Search", + 0, _("Foreign Audio Search"), 1, TRUE, 2, "-1", 3, -1.0, @@ -2815,7 +2782,7 @@ generic_opts_set(GtkBuilder *builder, const gchar *name, combo_opts_t *opts) { gtk_list_store_append(store, &iter); gtk_list_store_set(store, &iter, - 0, opts->map[ii].option, + 0, _(opts->map[ii].option), 1, TRUE, 2, opts->map[ii].shortOpt, 3, opts->map[ii].ivalue, @@ -2839,7 +2806,7 @@ small_opts_set(GtkBuilder *builder, const gchar *name, combo_opts_t *opts) for (ii = 0; ii < opts->count; ii++) { gtk_list_store_append(store, &iter); - str = g_strdup_printf("<small>%s</small>", opts->map[ii].option); + str = g_strdup_printf("<small>%s</small>", _(opts->map[ii].option)); gtk_list_store_set(store, &iter, 0, str, 1, TRUE, @@ -4362,9 +4329,9 @@ ghb_validate_filters(GValue *settings) if (!ghb_validate_filter_string(str, -1)) { message = g_strdup_printf( - "Invalid Deinterlace Settings:\n\n%s\n", + _("Invalid Deinterlace Settings:\n\n%s\n"), str); - ghb_message_dialog(GTK_MESSAGE_ERROR, message, "Cancel", NULL); + ghb_message_dialog(GTK_MESSAGE_ERROR, message, _("Cancel"), NULL); g_free(message); g_free(str); return FALSE; @@ -4379,9 +4346,9 @@ ghb_validate_filters(GValue *settings) if (!ghb_validate_filter_string(str, -1)) { message = g_strdup_printf( - "Invalid Detelecine Settings:\n\n%s\n", + _("Invalid Detelecine Settings:\n\n%s\n"), str); - ghb_message_dialog(GTK_MESSAGE_ERROR, message, "Cancel", NULL); + ghb_message_dialog(GTK_MESSAGE_ERROR, message, _("Cancel"), NULL); g_free(message); g_free(str); return FALSE; @@ -4396,9 +4363,9 @@ ghb_validate_filters(GValue *settings) if (!ghb_validate_filter_string(str, -1)) { message = g_strdup_printf( - "Invalid Decomb Settings:\n\n%s\n", + N_("Invalid Decomb Settings:\n\n%s\n"), str); - ghb_message_dialog(GTK_MESSAGE_ERROR, message, "Cancel", NULL); + ghb_message_dialog(GTK_MESSAGE_ERROR, message, _("Cancel"), NULL); g_free(message); g_free(str); return FALSE; @@ -4413,9 +4380,9 @@ ghb_validate_filters(GValue *settings) if (!ghb_validate_filter_string(str, -1)) { message = g_strdup_printf( - "Invalid Denoise Settings:\n\n%s\n", + _("Invalid Denoise Settings:\n\n%s\n"), str); - ghb_message_dialog(GTK_MESSAGE_ERROR, message, "Cancel", NULL); + ghb_message_dialog(GTK_MESSAGE_ERROR, message, _("Cancel"), NULL); g_free(str); g_free(message); return FALSE; @@ -4437,10 +4404,10 @@ ghb_validate_video(GValue *settings) { // mp4/theora combination is not supported. message = g_strdup_printf( - "Theora is not supported in the MP4 container.\n\n" + _("Theora is not supported in the MP4 container.\n\n" "You should choose a different video codec or container.\n" - "If you continue, FFMPEG will be chosen for you."); - if (!ghb_message_dialog(GTK_MESSAGE_WARNING, message, "Cancel", "Continue")) + "If you continue, FFMPEG will be chosen for you.")); + if (!ghb_message_dialog(GTK_MESSAGE_WARNING, message, _("Cancel"), _("Continue"))) { g_free(message); return FALSE; @@ -4484,10 +4451,10 @@ ghb_validate_subtitles(GValue *settings) // MP4 can only handle burned vobsubs. make sure there isn't // already something burned in the list message = g_strdup_printf( - "Only one subtitle may be burned into the video.\n\n" + _("Only one subtitle may be burned into the video.\n\n" "You should change your subtitle selections.\n" - "If you continue, some subtitles will be lost."); - if (!ghb_message_dialog(GTK_MESSAGE_WARNING, message, "Cancel", "Continue")) + "If you continue, some subtitles will be lost.")); + if (!ghb_message_dialog(GTK_MESSAGE_WARNING, message, _("Cancel"), _("Continue"))) { g_free(message); return FALSE; @@ -4507,11 +4474,11 @@ ghb_validate_subtitles(GValue *settings) if (!g_file_test(filename, G_FILE_TEST_IS_REGULAR)) { message = g_strdup_printf( - "Srt file does not exist or not a regular file.\n\n" + _("Srt file does not exist or not a regular file.\n\n" "You should choose a valid file.\n" - "If you continue, this subtitle will be ignored."); + "If you continue, this subtitle will be ignored.")); if (!ghb_message_dialog(GTK_MESSAGE_WARNING, message, - "Cancel", "Continue")) + _("Cancel"), _("Continue"))) { g_free(message); return FALSE; @@ -4567,10 +4534,10 @@ ghb_validate_audio(GValue *settings) { // Not supported. AC3 is passthrough only, so input must be AC3 message = g_strdup_printf( - "The source does not support Pass-Thru.\n\n" + _("The source does not support Pass-Thru.\n\n" "You should choose a different audio codec.\n" - "If you continue, one will be chosen for you."); - if (!ghb_message_dialog(GTK_MESSAGE_WARNING, message, "Cancel", "Continue")) + "If you continue, one will be chosen for you.")); + if (!ghb_message_dialog(GTK_MESSAGE_WARNING, message, _("Cancel"), _("Continue"))) { g_free(message); return FALSE; @@ -4607,10 +4574,10 @@ ghb_validate_audio(GValue *settings) if (a_unsup) { message = g_strdup_printf( - "%s is not supported in the %s container.\n\n" + _("%s is not supported in the %s container.\n\n" "You should choose a different audio codec.\n" - "If you continue, one will be chosen for you.", a_unsup, mux_s); - if (!ghb_message_dialog(GTK_MESSAGE_WARNING, message, "Cancel", "Continue")) + "If you continue, one will be chosen for you."), a_unsup, mux_s); + if (!ghb_message_dialog(GTK_MESSAGE_WARNING, message, _("Cancel"), _("Continue"))) { g_free(message); return FALSE; @@ -4632,10 +4599,10 @@ ghb_validate_audio(GValue *settings) if (mix_unsup) { message = g_strdup_printf( - "The source audio does not support %s mixdown.\n\n" + _("The source audio does not support %s mixdown.\n\n" "You should choose a different mixdown.\n" - "If you continue, one will be chosen for you.", mix_unsup); - if (!ghb_message_dialog(GTK_MESSAGE_WARNING, message, "Cancel", "Continue")) + "If you continue, one will be chosen for you."), mix_unsup); + if (!ghb_message_dialog(GTK_MESSAGE_WARNING, message, _("Cancel"), _("Continue"))) { g_free(message); return FALSE; @@ -4692,13 +4659,13 @@ ghb_validate_vquality(GValue *settings) if (vcodec == HB_VCODEC_X264 && vquality == 0.0) { message = g_strdup_printf( - "Warning: lossless h.264 selected\n\n" + _("Warning: lossless h.264 selected\n\n" "Lossless h.264 is not well supported by\n" "many players and editors.\n\n" "It will produce enormous output files.\n\n" - "Are you sure you wish to use this setting?"); + "Are you sure you wish to use this setting?")); if (!ghb_message_dialog(GTK_MESSAGE_QUESTION, message, - "Cancel", "Continue")) + _("Cancel"), _("Continue"))) { g_free(message); return FALSE; @@ -4709,12 +4676,12 @@ ghb_validate_vquality(GValue *settings) else if (vquality < min || vquality > max) { message = g_strdup_printf( - "Interesting video quality choice: %d\n\n" + _("Interesting video quality choice: %d\n\n" "Typical values range from %d to %d.\n\n" - "Are you sure you wish to use this setting?", + "Are you sure you wish to use this setting?"), (gint)vquality, min, max); if (!ghb_message_dialog(GTK_MESSAGE_QUESTION, message, - "Cancel", "Continue")) + _("Cancel"), _("Continue"))) { g_free(message); return FALSE; diff --git a/gtk/src/hb-backend.h b/gtk/src/hb-backend.h index 03d0ce4ed..68a91cf01 100644 --- a/gtk/src/hb-backend.h +++ b/gtk/src/hb-backend.h @@ -141,7 +141,6 @@ gchar* ghb_dvd_volname(const gchar *device); gint ghb_get_title_number(gint titleindex); int ghb_get_title_count(); gint ghb_subtitle_track_source(GValue *settings, gint track); -const char* ghb_subtitle_track_source_name(GValue *settings, gint track); const gchar* ghb_subtitle_track_lang(GValue *settings, gint track); gboolean ghb_validate_vquality(GValue *settings); diff --git a/gtk/src/main.c b/gtk/src/main.c index b656f7812..b23936d34 100644 --- a/gtk/src/main.c +++ b/gtk/src/main.c @@ -52,6 +52,7 @@ #endif #include <glib/gstdio.h> +#include <glib/gi18n.h> #include <gio/gio.h> #include "hb.h" #include "renderer_button.h" @@ -73,16 +74,7 @@ /* * Standard gettext macros. */ -#ifdef ENABLE_NLS -# include <libintl.h> -# undef _ -# define _(String) dgettext(PACKAGE, String) -# ifdef gettext_noop -# define N_(String) gettext_noop(String) -# else -# define N_(String) (String) -# endif -#else +#ifndef ENABLE_NLS # define textdomain(String) (String) # define gettext(String) (String) # define dgettext(Domain,Message) (Message) @@ -688,9 +680,9 @@ static gboolean ghb_debug = FALSE; static GOptionEntry entries[] = { - { "device", 'd', 0, G_OPTION_ARG_FILENAME, &dvd_device, "The device or file to encode", NULL }, - { "preset", 'p', 0, G_OPTION_ARG_STRING, &arg_preset, "The preset values to use for encoding", NULL }, - { "debug", 'x', 0, G_OPTION_ARG_NONE, &ghb_debug, "Spam a lot", NULL }, + { "device", 'd', 0, G_OPTION_ARG_FILENAME, &dvd_device, N_("The device or file to encode"), NULL }, + { "preset", 'p', 0, G_OPTION_ARG_STRING, &arg_preset, N_("The preset values to use for encoding"), NULL }, + { "debug", 'x', 0, G_OPTION_ARG_NONE, &ghb_debug, N_("Spam a lot"), NULL }, { NULL } }; @@ -857,7 +849,7 @@ main(int argc, char *argv[]) textdomain(GETTEXT_PACKAGE); #endif - context = g_option_context_new("- Transcode media formats"); + context = g_option_context_new(_("- Transcode media formats")); g_option_context_add_main_entries(context, entries, GETTEXT_PACKAGE); g_option_context_add_group(context, gtk_get_option_group(TRUE)); #if defined(_ENABLE_GST) diff --git a/gtk/src/preview.c b/gtk/src/preview.c index 126943a54..561deb15a 100644 --- a/gtk/src/preview.c +++ b/gtk/src/preview.c @@ -14,6 +14,7 @@ #include <unistd.h> #include <glib.h> #include <glib/gstdio.h> +#include <glib/gi18n.h> #include <glib-object.h> #include "ghbcompat.h" @@ -558,8 +559,8 @@ live_preview_cb(GstBus *bus, GstMessage *msg, gpointer data) gchar *message, *desc; desc = gst_missing_plugin_message_get_description(msg); message = g_strdup_printf( - "Missing GStreamer plugin\n" - "Audio or Video may not play as expected\n\n%s", + _("Missing GStreamer plugin\n" + "Audio or Video may not play as expected\n\n%s"), desc); ghb_message_dialog(GTK_MESSAGE_WARNING, message, "Ok", NULL); g_free(message); @@ -1286,16 +1287,16 @@ picture_settings_alt2_clicked_cb(GtkWidget *xwidget, signal_user_data_t *ud) window = GHB_WIDGET(ud->builder, "settings_window"); if (!active) { - gtk_button_set_label(GTK_BUTTON(toggle), "Hide Settings"); + gtk_button_set_label(GTK_BUTTON(toggle), _("Hide Settings")); gtk_widget_set_tooltip_text(toggle, - "Hide the picture settings window while " - "leaving the preview visible."); + _("Hide the picture settings window while " + "leaving the preview visible.")); gtk_widget_show(window); } else { - gtk_button_set_label(GTK_BUTTON(toggle), "Show Settings"); - gtk_widget_set_tooltip_text(toggle, "Show picture settings."); + gtk_button_set_label(GTK_BUTTON(toggle), _("Show Settings")); + gtk_widget_set_tooltip_text(toggle, _("Show picture settings.")); gtk_widget_hide(window); } } diff --git a/gtk/src/queuehandler.c b/gtk/src/queuehandler.c index d8b6f6d2c..8642bfe21 100644 --- a/gtk/src/queuehandler.c +++ b/gtk/src/queuehandler.c @@ -13,6 +13,7 @@ #include "ghbcompat.h" #include <glib/gstdio.h> +#include <glib/gi18n.h> #include <gio/gio.h> #include "hb.h" #include "settings.h" @@ -93,13 +94,13 @@ add_to_queue_list(signal_user_data_t *ud, GValue *settings, GtkTreeIter *piter) vqtype = ghb_settings_get_boolean(settings, "vquality_type_constant"); if (!vqtype) pass2 = ghb_settings_get_boolean(settings, "VideoTwoPass"); - const gchar *points = "Chapters"; + const gchar *points = _("Chapters"); if (ghb_settings_combo_int(settings, "PtoPType") == 0) - points = "Chapters"; + points = _("Chapters"); else if (ghb_settings_combo_int(settings, "PtoPType") == 1) - points = "Seconds"; + points = _("Seconds"); else if (ghb_settings_combo_int(settings, "PtoPType") == 2) - points = "Frames"; + points = _("Frames"); info = g_strdup_printf ( "<big><b>%s</b></big> " @@ -549,11 +550,11 @@ validate_settings(signal_user_data_t *ud, GValue *settings, gint batch) if (strcmp(dest, filename) == 0) { message = g_strdup_printf( - "Destination: %s\n\n" + _("Destination: %s\n\n" "Another queued job has specified the same destination.\n" - "Do you want to overwrite?", + "Do you want to overwrite?"), dest); - if (!ghb_message_dialog(GTK_MESSAGE_QUESTION, message, "Cancel", "Overwrite")) + if (!ghb_message_dialog(GTK_MESSAGE_QUESTION, message, _("Cancel"), _("Overwrite"))) { g_free(filename); g_free(dest); @@ -569,10 +570,10 @@ validate_settings(signal_user_data_t *ud, GValue *settings, gint batch) if (!g_file_test(destdir, G_FILE_TEST_IS_DIR)) { message = g_strdup_printf( - "Destination: %s\n\n" - "This is not a valid directory.", + _("Destination: %s\n\n" + "This is not a valid directory."), destdir); - ghb_message_dialog(GTK_MESSAGE_ERROR, message, "Cancel", NULL); + ghb_message_dialog(GTK_MESSAGE_ERROR, message, _("Cancel"), NULL); g_free(dest); g_free(message); g_free(destdir); @@ -583,10 +584,10 @@ validate_settings(signal_user_data_t *ud, GValue *settings, gint batch) if (g_access(destdir, R_OK|W_OK) != 0) { message = g_strdup_printf( - "Destination: %s\n\n" - "Can not read or write the directory.", + _("Destination: %s\n\n" + "Can not read or write the directory."), destdir); - ghb_message_dialog(GTK_MESSAGE_ERROR, message, "Cancel", NULL); + ghb_message_dialog(GTK_MESSAGE_ERROR, message, _("Cancel"), NULL); g_free(dest); g_free(message); g_free(destdir); @@ -614,10 +615,10 @@ validate_settings(signal_user_data_t *ud, GValue *settings, gint batch) if (size < fsize) { message = g_strdup_printf( - "Destination filesystem is almost full: %uM free\n\n" - "Encode may be incomplete if you proceed.\n", + _("Destination filesystem is almost full: %uM free\n\n" + "Encode may be incomplete if you proceed.\n"), (guint)(size / (1024L*1024L))); - if (!ghb_message_dialog(GTK_MESSAGE_QUESTION, message, "Cancel", "Proceed")) + if (!ghb_message_dialog(GTK_MESSAGE_QUESTION, message, _("Cancel"), _("Proceed"))) { g_free(dest); g_free(message); @@ -635,11 +636,11 @@ validate_settings(signal_user_data_t *ud, GValue *settings, gint batch) if (g_file_test(dest, G_FILE_TEST_EXISTS)) { message = g_strdup_printf( - "Destination: %s\n\n" + _("Destination: %s\n\n" "File already exists.\n" - "Do you want to overwrite?", + "Do you want to overwrite?"), dest); - if (!ghb_message_dialog(GTK_MESSAGE_QUESTION, message, "Cancel", "Overwrite")) + if (!ghb_message_dialog(GTK_MESSAGE_QUESTION, message, _("Cancel"), _("Overwrite"))) { g_free(dest); g_free(message); @@ -1028,60 +1029,60 @@ ghb_queue_buttons_grey(signal_user_data_t *ud) { gtk_widget_set_sensitive (widget, TRUE); gtk_tool_button_set_icon_name(GTK_TOOL_BUTTON(widget), "hb-stop"); - gtk_tool_button_set_label(GTK_TOOL_BUTTON(widget), "Stop"); - gtk_tool_item_set_tooltip_text(GTK_TOOL_ITEM(widget), "Stop Encoding"); + gtk_tool_button_set_label(GTK_TOOL_BUTTON(widget), _("Stop")); + gtk_tool_item_set_tooltip_text(GTK_TOOL_ITEM(widget), _("Stop Encoding")); } else { gtk_widget_set_sensitive (widget, show_start); gtk_tool_button_set_icon_name(GTK_TOOL_BUTTON(widget), "hb-start"); - gtk_tool_button_set_label(GTK_TOOL_BUTTON(widget), "Start"); - gtk_tool_item_set_tooltip_text(GTK_TOOL_ITEM(widget), "Start Encoding"); + gtk_tool_button_set_label(GTK_TOOL_BUTTON(widget), _("Start")); + gtk_tool_item_set_tooltip_text(GTK_TOOL_ITEM(widget), _("Start Encoding")); } widget = GHB_WIDGET (ud->builder, "queue_start2"); if (show_stop) { gtk_widget_set_sensitive (widget, TRUE); gtk_tool_button_set_icon_name(GTK_TOOL_BUTTON(widget), "hb-stop"); - gtk_tool_button_set_label(GTK_TOOL_BUTTON(widget), "Stop"); - gtk_tool_item_set_tooltip_text(GTK_TOOL_ITEM(widget), "Stop Encoding"); + gtk_tool_button_set_label(GTK_TOOL_BUTTON(widget), _("Stop")); + gtk_tool_item_set_tooltip_text(GTK_TOOL_ITEM(widget), _("Stop Encoding")); } else { gtk_widget_set_sensitive (widget, show_start); gtk_tool_button_set_icon_name(GTK_TOOL_BUTTON(widget), "hb-start"); - gtk_tool_button_set_label(GTK_TOOL_BUTTON(widget), "Start"); - gtk_tool_item_set_tooltip_text(GTK_TOOL_ITEM(widget), "Start Encoding"); + gtk_tool_button_set_label(GTK_TOOL_BUTTON(widget), _("Start")); + gtk_tool_item_set_tooltip_text(GTK_TOOL_ITEM(widget), _("Start Encoding")); } widget = GHB_WIDGET (ud->builder, "queue_pause1"); if (paused) { gtk_widget_set_sensitive (widget, show_stop); gtk_tool_button_set_icon_name(GTK_TOOL_BUTTON(widget), "hb-start"); - gtk_tool_button_set_label(GTK_TOOL_BUTTON(widget), "Resume"); - gtk_tool_item_set_tooltip_text(GTK_TOOL_ITEM(widget), "Resume Encoding"); + gtk_tool_button_set_label(GTK_TOOL_BUTTON(widget), _("Resume")); + gtk_tool_item_set_tooltip_text(GTK_TOOL_ITEM(widget), _("Resume Encoding")); } else { gtk_widget_set_sensitive (widget, show_stop); gtk_tool_button_set_icon_name(GTK_TOOL_BUTTON(widget), "hb-pause"); - gtk_tool_button_set_label(GTK_TOOL_BUTTON(widget), "Pause"); - gtk_tool_item_set_tooltip_text(GTK_TOOL_ITEM(widget), "Pause Encoding"); + gtk_tool_button_set_label(GTK_TOOL_BUTTON(widget), _("Pause")); + gtk_tool_item_set_tooltip_text(GTK_TOOL_ITEM(widget), _("Pause Encoding")); } widget = GHB_WIDGET (ud->builder, "queue_pause2"); if (paused) { gtk_widget_set_sensitive (widget, show_stop); gtk_tool_button_set_icon_name(GTK_TOOL_BUTTON(widget), "hb-start"); - gtk_tool_button_set_label(GTK_TOOL_BUTTON(widget), "Resume"); - gtk_tool_item_set_tooltip_text(GTK_TOOL_ITEM(widget), "Resume Encoding"); + gtk_tool_button_set_label(GTK_TOOL_BUTTON(widget), _("Resume")); + gtk_tool_item_set_tooltip_text(GTK_TOOL_ITEM(widget), _("Resume Encoding")); } else { gtk_widget_set_sensitive (widget, show_stop); gtk_tool_button_set_icon_name(GTK_TOOL_BUTTON(widget), "hb-pause"); - gtk_tool_button_set_label(GTK_TOOL_BUTTON(widget), "Pause"); - gtk_tool_item_set_tooltip_text(GTK_TOOL_ITEM(widget), "Pause Encoding"); + gtk_tool_button_set_label(GTK_TOOL_BUTTON(widget), _("Pause")); + gtk_tool_item_set_tooltip_text(GTK_TOOL_ITEM(widget), _("Pause Encoding")); } action = GHB_ACTION (ud->builder, "queue_start_menu"); @@ -1090,15 +1091,15 @@ ghb_queue_buttons_grey(signal_user_data_t *ud) gtk_action_set_sensitive (action, TRUE); #if GTK_CHECK_VERSION(2, 16, 0) gtk_action_set_icon_name(action, "hb-stop"); - gtk_action_set_label(action, "S_top Queue"); - gtk_action_set_tooltip(action, "Stop Encoding"); + gtk_action_set_label(action, _("S_top Queue")); + gtk_action_set_tooltip(action, _("Stop Encoding")); #else g_object_set_property(G_OBJECT(action), "icon-name", ghb_string_value("hb-stop")); g_object_set_property(G_OBJECT(action), "label", - ghb_string_value("S_top Queue")); + ghb_string_value(_("S_top Queue"))); g_object_set_property(G_OBJECT(action), "tooltip", - ghb_string_value("Stop Encoding")); + ghb_string_value(_("Stop Encoding"))); #endif } else @@ -1106,15 +1107,15 @@ ghb_queue_buttons_grey(signal_user_data_t *ud) gtk_action_set_sensitive (action, show_start); #if GTK_CHECK_VERSION(2, 16, 0) gtk_action_set_icon_name(action, "hb-start"); - gtk_action_set_label(action, "_Start Queue"); - gtk_action_set_tooltip(action, "Start Encoding"); + gtk_action_set_label(action, _("_Start Queue")); + gtk_action_set_tooltip(action, _("Start Encoding")); #else g_object_set_property(G_OBJECT(action), "icon-name", ghb_string_value("hb-start")); g_object_set_property(G_OBJECT(action), "label", - ghb_string_value("_Start Queue")); + ghb_string_value(_("_Start Queue"))); g_object_set_property(G_OBJECT(action), "tooltip", - ghb_string_value("Start Encoding")); + ghb_string_value(_("Start Encoding"))); #endif } action = GHB_ACTION (ud->builder, "queue_pause_menu"); @@ -1129,9 +1130,9 @@ ghb_queue_buttons_grey(signal_user_data_t *ud) g_object_set_property(G_OBJECT(action), "icon-name", ghb_string_value("hb-start")); g_object_set_property(G_OBJECT(action), "label", - ghb_string_value("_Resume Queue")); + ghb_string_value(_("_Resume Queue"))); g_object_set_property(G_OBJECT(action), "tooltip", - ghb_string_value("Resume Encoding")); + ghb_string_value(_("Resume Encoding"))); #endif } else @@ -1139,15 +1140,15 @@ ghb_queue_buttons_grey(signal_user_data_t *ud) gtk_action_set_sensitive (action, show_stop); #if GTK_CHECK_VERSION(2, 16, 0) gtk_action_set_icon_name(action, "hb-pause"); - gtk_action_set_label(action, "_Pause Queue"); - gtk_action_set_tooltip(action, "Pause Encoding"); + gtk_action_set_label(action, _("_Pause Queue")); + gtk_action_set_tooltip(action, _("Pause Encoding")); #else g_object_set_property(G_OBJECT(action), "icon-name", ghb_string_value("hb-pause")); g_object_set_property(G_OBJECT(action), "label", - ghb_string_value("_Pause Queue")); + ghb_string_value(_("_Pause Queue"))); g_object_set_property(G_OBJECT(action), "tooltip", - ghb_string_value("Pause Encoding")); + ghb_string_value(_("Pause Encoding"))); #endif } } @@ -1180,8 +1181,8 @@ queue_start_clicked_cb(GtkWidget *xwidget, signal_user_data_t *ud) if (state & (GHB_STATE_WORKING | GHB_STATE_SEARCHING | GHB_STATE_SCANNING | GHB_STATE_MUXING)) { - ghb_cancel_encode(ud, "You are currently encoding. " - "What would you like to do?"); + ghb_cancel_encode(ud, _("You are currently encoding. " + "What would you like to do?\n\n")); return; } @@ -1260,12 +1261,9 @@ find_pid: if (unfinished) { message = g_strdup_printf( - "You have %d unfinished job%s in a saved queue.\n\n" - "Would you like to reload %s?", - unfinished, - (unfinished > 1) ? "s" : "", - (unfinished > 1) ? "them" : "it"); - if (ghb_message_dialog(GTK_MESSAGE_QUESTION, message, "No", "Yes")) + _("You have %d unfinished job(s) in a saved queue.\n\n" + "Would you like to reload them?"), unfinished); + if (ghb_message_dialog(GTK_MESSAGE_QUESTION, message, _("No"), _("Yes"))) { GtkWidget *widget = GHB_WIDGET (ud->builder, "queue_window"); gtk_widget_show (widget); |