Translate labels of buttons created in code
This commit is contained in:
parent
79148a56f4
commit
a31bfaa53a
6 changed files with 210 additions and 185 deletions
|
|
@ -16,7 +16,7 @@ if os.path.exists(datadirdev):
|
|||
localedir = None
|
||||
localedirdev = os.path.join(srcdir, '..', 'locale')
|
||||
if os.path.exists(localedirdev):
|
||||
localedir = datadirdev
|
||||
localedir = localedirdev
|
||||
|
||||
# Set GSettings schema dir (if not set already)
|
||||
if not os.environ.get('GSETTINGS_SCHEMA_DIR'):
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ try:
|
|||
use_keyring = True
|
||||
except:
|
||||
use_keyring = False
|
||||
import locale
|
||||
import logging
|
||||
import math
|
||||
import sys
|
||||
|
|
@ -1223,7 +1224,7 @@ class PlaylistPanel(GObject.GObject):
|
|||
self._playlist_grid.set_tooltip_column(1)
|
||||
# Action bar (normal)
|
||||
actionbar = builder.get_object('playlist-actionbar')
|
||||
cancel_button = Gtk.Button('cancel')
|
||||
cancel_button = Gtk.Button(locale.gettext("cancel"))
|
||||
cancel_button.connect('clicked', self.on_selection_cancel_clicked)
|
||||
actionbar.pack_start(cancel_button)
|
||||
remove_button = Gtk.Button('remove')
|
||||
|
|
@ -1240,10 +1241,10 @@ class PlaylistPanel(GObject.GObject):
|
|||
self._standalone_image = builder.get_object('playlist-standalone-image')
|
||||
# Action bar (standalone)
|
||||
actionbar_standalone = builder.get_object('playlist-standalone-actionbar')
|
||||
play_button = Gtk.Button('play')
|
||||
play_button = Gtk.Button(locale.gettext("play"))
|
||||
play_button.connect('clicked', self.on_standalone_play_clicked)
|
||||
actionbar_standalone.pack_end(play_button)
|
||||
remove_button = Gtk.Button('remove')
|
||||
remove_button = Gtk.Button(locale.gettext("remove"))
|
||||
remove_button.connect('clicked', self.on_standalone_remove_clicked)
|
||||
actionbar_standalone.pack_end(remove_button)
|
||||
|
||||
|
|
@ -1545,7 +1546,7 @@ class LibraryPanel(GObject.GObject):
|
|||
self._library_grid.set_tooltip_column(1)
|
||||
# Action bar (normal)
|
||||
actionbar = builder.get_object('library-actionbar')
|
||||
cancel_button = Gtk.Button("cancel")
|
||||
cancel_button = Gtk.Button(locale.gettext("cancel"))
|
||||
cancel_button.connect('clicked', self.on_selection_cancel_clicked)
|
||||
actionbar.pack_start(cancel_button)
|
||||
add_button = Gtk.Button("queue")
|
||||
|
|
@ -1562,10 +1563,10 @@ class LibraryPanel(GObject.GObject):
|
|||
self._standalone_image = builder.get_object('library-standalone-image')
|
||||
# Action bar (standalone)
|
||||
actionbar_standalone = builder.get_object('library-standalone-actionbar')
|
||||
play_button = Gtk.Button("play")
|
||||
play_button = Gtk.Button(locale.gettext("play"))
|
||||
play_button.connect('clicked', self.on_standalone_play_clicked)
|
||||
actionbar_standalone.pack_end(play_button)
|
||||
queue_button = Gtk.Button("queue")
|
||||
queue_button = Gtk.Button(locale.gettext("queue"))
|
||||
queue_button.connect('clicked', self.on_standalone_queue_clicked)
|
||||
actionbar_standalone.pack_end(queue_button)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue