libgimpwidgets, plug-ins: translate dialog buttons

GTK no longer contains stock labels, so the button
labels needed to be marked as translatable.
This commit is contained in:
Anders Jonsson
2023-07-15 02:29:49 +02:00
committed by Alx Sa
parent 9c87aaeebd
commit caff1e61e4
7 changed files with 22 additions and 22 deletions

View File

@ -174,7 +174,7 @@ gimp_dialog_constructed (GObject *object)
if (show_help_button && private->help_func && private->help_id)
{
private->help_button = gtk_dialog_add_button (GTK_DIALOG (object),
("_Help"),
_("_Help"),
GTK_RESPONSE_HELP);
}
}

View File

@ -89,14 +89,14 @@ def save_colorxhtml(procedure, run_mode, image, n_layers, layers, file, args, da
use_header_bar = Gtk.Settings.get_default().get_property("gtk-dialogs-use-header")
dialog = Gtk.Dialog(use_header_bar=use_header_bar,
title=_("Save as colored HTML text..."))
dialog.add_button("_Cancel", Gtk.ResponseType.CANCEL)
dialog.add_button("_OK", Gtk.ResponseType.OK)
dialog.add_button(_("_Cancel"), Gtk.ResponseType.CANCEL)
dialog.add_button(_("_OK"), Gtk.ResponseType.OK)
choose_file_dialog = Gtk.FileChooserDialog(use_header_bar=use_header_bar,
title=_("Read characters from file..."),
action=Gtk.FileChooserAction.OPEN)
choose_file_dialog.add_button("_Cancel", Gtk.ResponseType.CANCEL)
choose_file_dialog.add_button("_OK", Gtk.ResponseType.OK)
choose_file_dialog.add_button(_("_Cancel"), Gtk.ResponseType.CANCEL)
choose_file_dialog.add_button(_("_OK"), Gtk.ResponseType.OK)
def choose_file(button, user_data=None):
choose_file_dialog.show()

View File

@ -121,8 +121,8 @@ def gradient_css_save(procedure, args, data):
file_chooser_dialog = Gtk.FileChooserDialog(use_header_bar=use_header_bar,
title=_("Save as CSS file..."),
action=Gtk.FileChooserAction.SAVE)
file_chooser_dialog.add_button("_Cancel", Gtk.ResponseType.CANCEL)
file_chooser_dialog.add_button("_OK", Gtk.ResponseType.OK)
file_chooser_dialog.add_button(_("_Cancel"), Gtk.ResponseType.CANCEL)
file_chooser_dialog.add_button(_("_OK"), Gtk.ResponseType.OK)
#Connect config so reset works on custom widget
def gradient_reset (*args):

View File

@ -201,8 +201,8 @@ def run(procedure, run_mode, image, n_layers, layers, args, data):
use_header_bar = Gtk.Settings.get_default().get_property("gtk-dialogs-use-header")
dialog = GimpUi.Dialog(use_header_bar=use_header_bar,
title=_("Histogram Export..."))
dialog.add_button("_Cancel", Gtk.ResponseType.CANCEL)
dialog.add_button("_OK", Gtk.ResponseType.OK)
dialog.add_button(_("_Cancel"), Gtk.ResponseType.CANCEL)
dialog.add_button(_("_OK"), Gtk.ResponseType.OK)
vbox = Gtk.Box(orientation=Gtk.Orientation.VERTICAL,
homogeneous=False, spacing=10)
@ -243,8 +243,8 @@ def run(procedure, run_mode, image, n_layers, layers, args, data):
file_chooser_dialog = Gtk.FileChooserDialog(use_header_bar=use_header_bar,
title=_("Histogram Export file..."),
action=Gtk.FileChooserAction.SAVE)
file_chooser_dialog.add_button("_Cancel", Gtk.ResponseType.CANCEL)
file_chooser_dialog.add_button("_OK", Gtk.ResponseType.OK)
file_chooser_dialog.add_button(_("_Cancel"), Gtk.ResponseType.CANCEL)
file_chooser_dialog.add_button(_("_OK"), Gtk.ResponseType.OK)
# Bucket size parameter
label = Gtk.Label.new_with_mnemonic(_("_Bucket Size"))

View File

@ -142,8 +142,8 @@ class PaletteOffset (Gimp.PlugIn):
dialog = GimpUi.Dialog(use_header_bar=use_header_bar,
title=_("Offset Palette..."))
dialog.add_button("_Cancel", Gtk.ResponseType.CANCEL)
dialog.add_button("_OK", Gtk.ResponseType.OK)
dialog.add_button(_("_Cancel"), Gtk.ResponseType.CANCEL)
dialog.add_button(_("_OK"), Gtk.ResponseType.OK)
box = Gtk.Box(orientation=Gtk.Orientation.VERTICAL,
homogeneous=False, spacing=12)

View File

@ -76,10 +76,10 @@ def run(procedure, args, data):
self.set_property("help-id", PROC_NAME)
Gtk.Window.set_title(self, _("Python Console"))
Gtk.Window.set_role(self, PROC_NAME)
Gtk.Dialog.add_button(self, "_Save", Gtk.ResponseType.OK)
Gtk.Dialog.add_button(self, "Cl_ear", RESPONSE_CLEAR)
Gtk.Dialog.add_button(self, _("_Save"), Gtk.ResponseType.OK)
Gtk.Dialog.add_button(self, _("Cl_ear"), RESPONSE_CLEAR)
Gtk.Dialog.add_button(self, _("_Browse..."), RESPONSE_BROWSE)
Gtk.Dialog.add_button(self, "_Close", Gtk.ResponseType.CLOSE)
Gtk.Dialog.add_button(self, _("_Close"), Gtk.ResponseType.CLOSE)
Gtk.Widget.set_name (self, PROC_NAME)
GimpUi.Dialog.set_alternative_button_order_from_array(self,
@ -256,8 +256,8 @@ def run(procedure, args, data):
dlg = GimpUi.ProcBrowserDialog(use_header_bar=use_header_bar)
Gtk.Window.set_title(dlg, _("Python Procedure Browser"))
Gtk.Window.set_role(dlg, PROC_NAME)
Gtk.Dialog.add_button(dlg, "Apply", Gtk.ResponseType.APPLY)
Gtk.Dialog.add_button(dlg, "Close", Gtk.ResponseType.CLOSE)
Gtk.Dialog.add_button(dlg, _("_Apply"), Gtk.ResponseType.APPLY)
Gtk.Dialog.add_button(dlg, _("_Close"), Gtk.ResponseType.CLOSE)
Gtk.Dialog.set_default_response(self, Gtk.ResponseType.OK)
GimpUi.Dialog.set_alternative_button_order_from_array(dlg,
@ -308,8 +308,8 @@ def run(procedure, args, data):
dlg = Gtk.FileChooserDialog()
Gtk.Window.set_title(dlg, _("Save Python-Fu Console Output"))
Gtk.Window.set_transient_for(dlg, self)
Gtk.Dialog.add_button(dlg, "_Cancel", Gtk.ResponseType.CANCEL)
Gtk.Dialog.add_button(dlg, "_Save", Gtk.ResponseType.OK)
Gtk.Dialog.add_button(dlg, _("_Cancel"), Gtk.ResponseType.CANCEL)
Gtk.Dialog.add_button(dlg, _("_Save"), Gtk.ResponseType.OK)
Gtk.Dialog.set_default_response(self, Gtk.ResponseType.OK)
GimpUi.Dialog.set_alternative_button_order_from_array(dlg,
[ Gtk.ResponseType.OK,

View File

@ -1721,8 +1721,8 @@ class SpyroWindow():
def dialog_button_box():
self.dialog.add_button("_Cancel", Gtk.ResponseType.CANCEL)
self.ok_btn = self.dialog.add_button("_OK", Gtk.ResponseType.OK)
self.dialog.add_button(_("_Cancel"), Gtk.ResponseType.CANCEL)
self.ok_btn = self.dialog.add_button(_("_OK"), Gtk.ResponseType.OK)
btn = self.dialog.add_button(_("Re_draw"), RESPONSE_REDRAW)
btn.set_tooltip_text(
_("If you change the settings of a tool, change color, or change the selection, "