mirror of
https://git.pwmt.org/pwmt/zathura.git
synced 2024-12-28 06:36:00 +01:00
Translate error messages
Signed-off-by: Sebastian Ramacher <sebastian+dev@ramacher.at>
This commit is contained in:
parent
eea53de243
commit
ac8be2d528
1 changed files with 8 additions and 3 deletions
11
print.c
11
print.c
|
@ -8,6 +8,7 @@
|
||||||
#include <girara/utils.h>
|
#include <girara/utils.h>
|
||||||
#include <girara/statusbar.h>
|
#include <girara/statusbar.h>
|
||||||
#include <girara/session.h>
|
#include <girara/session.h>
|
||||||
|
#include <glib/gi18n.h>
|
||||||
|
|
||||||
static void cb_print_draw_page(GtkPrintOperation* print_operation,
|
static void cb_print_draw_page(GtkPrintOperation* print_operation,
|
||||||
GtkPrintContext* context, gint page_number,
|
GtkPrintContext* context, gint page_number,
|
||||||
|
@ -52,11 +53,15 @@ print(zathura_t* zathura)
|
||||||
g_signal_connect(print_operation, "done", G_CALLBACK(cb_print_done), zathura);
|
g_signal_connect(print_operation, "done", G_CALLBACK(cb_print_done), zathura);
|
||||||
|
|
||||||
/* print */
|
/* print */
|
||||||
|
GError* error = NULL;
|
||||||
GtkPrintOperationResult result = gtk_print_operation_run(print_operation,
|
GtkPrintOperationResult result = gtk_print_operation_run(print_operation,
|
||||||
GTK_PRINT_OPERATION_ACTION_PRINT_DIALOG, NULL, NULL);
|
GTK_PRINT_OPERATION_ACTION_PRINT_DIALOG,
|
||||||
|
NULL, &error);
|
||||||
|
|
||||||
if (result == GTK_PRINT_OPERATION_RESULT_ERROR) {
|
if (result == GTK_PRINT_OPERATION_RESULT_ERROR) {
|
||||||
girara_error("Error occurred while printing progress");
|
girara_notify(zathura->ui.session, GIRARA_ERROR, _("Printing failed: %s"),
|
||||||
|
error->message);
|
||||||
|
g_error_free(error);
|
||||||
}
|
}
|
||||||
|
|
||||||
g_object_unref(print_operation);
|
g_object_unref(print_operation);
|
||||||
|
@ -200,7 +205,7 @@ cb_print_done(GtkPrintOperation* operation, GtkPrintOperationResult result,
|
||||||
} else if (result == GTK_PRINT_OPERATION_RESULT_ERROR) {
|
} else if (result == GTK_PRINT_OPERATION_RESULT_ERROR) {
|
||||||
GError* error = NULL;
|
GError* error = NULL;
|
||||||
gtk_print_operation_get_error(operation, &error);
|
gtk_print_operation_get_error(operation, &error);
|
||||||
girara_notify(zathura->ui.session, GIRARA_ERROR, "Printing failed: %s",
|
girara_notify(zathura->ui.session, GIRARA_ERROR, _("Printing failed: %s"),
|
||||||
error->message);
|
error->message);
|
||||||
g_error_free(error);
|
g_error_free(error);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue