[gnome-music/wip/merge: 335/343] Mark some of the strings as translatable
- From: Ignacio Casal Quinteiro <icq src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-music/wip/merge: 335/343] Mark some of the strings as translatable
- Date: Thu, 25 Jul 2013 11:40:37 +0000 (UTC)
commit 5c8314af9459f888597e2a6ea5f91a2ac44c9788
Author: Arnel A. Borja <arnelborja src gnome org>
Date: Wed Jul 24 00:04:15 2013 +0800
Mark some of the strings as translatable
gnomemusic/albumArtCache.py | 3 ++-
gnomemusic/application.py | 3 ++-
gnomemusic/view.py | 9 +++++----
gnomemusic/widgets.py | 9 +++++----
gnomemusic/window.py | 2 +-
5 files changed, 15 insertions(+), 11 deletions(-)
---
diff --git a/gnomemusic/albumArtCache.py b/gnomemusic/albumArtCache.py
index 13092ee..f6c864d 100644
--- a/gnomemusic/albumArtCache.py
+++ b/gnomemusic/albumArtCache.py
@@ -1,4 +1,5 @@
from gi.repository import GdkPixbuf, Gio, GLib, Grl, Gdk
+from gettext import gettext as _
import cairo
from math import pi
@@ -35,7 +36,7 @@ class AlbumArtCache:
return title
uri = media.get_url()
if uri is None:
- return "Untitled"
+ return _("Untitled")
uri_file = Gio.File.new_for_path(uri)
basename = uri_file.get_basename()
diff --git a/gnomemusic/application.py b/gnomemusic/application.py
index 9ee556f..3dc94bc 100644
--- a/gnomemusic/application.py
+++ b/gnomemusic/application.py
@@ -1,4 +1,5 @@
from gi.repository import Gtk, Gio, GLib, Gdk
+from gettext import gettext as _
from gnomemusic.window import Window
from gnomemusic.mpris import MediaPlayer2Service
@@ -8,7 +9,7 @@ class Application(Gtk.Application):
Gtk.Application.__init__(self,
application_id='org.gnome.Music',
flags=Gio.ApplicationFlags.FLAGS_NONE)
- GLib.set_application_name("Music")
+ GLib.set_application_name(_("Music"))
cssProviderFile = Gio.File.new_for_uri('resource:///org/gnome/Music/application.css')
cssProvider = Gtk.CssProvider()
diff --git a/gnomemusic/view.py b/gnomemusic/view.py
index 5452c57..573acac 100644
--- a/gnomemusic/view.py
+++ b/gnomemusic/view.py
@@ -6,6 +6,7 @@ from gi.repository import Pango
from gi.repository import GLib
from gi.repository import GdkPixbuf
from gi.repository import Tracker
+from gettext import gettext as _
from gnomemusic.grilo import grilo
import gnomemusic.widgets as Widgets
from gnomemusic.query import Query
@@ -230,7 +231,7 @@ class Empty(Gtk.Stack):
class Albums(ViewContainer):
def __init__(self, header_bar, selection_toolbar, player):
- ViewContainer.__init__(self, "Albums", header_bar, selection_toolbar)
+ ViewContainer.__init__(self, _("Albums"), header_bar, selection_toolbar)
self.view.set_view_type(Gd.MainViewType.ICON)
self.countQuery = Query.ALBUMS_COUNT
self._albumWidget = Widgets.AlbumWidget(player)
@@ -266,7 +267,7 @@ class Albums(ViewContainer):
class Songs(ViewContainer):
def __init__(self, header_bar, selection_toolbar, player):
- ViewContainer.__init__(self, "Songs", header_bar, selection_toolbar)
+ ViewContainer.__init__(self, _("Songs"), header_bar, selection_toolbar)
self.countQuery = Query.SONGS_COUNT
self._items = {}
self.isStarred = None
@@ -405,13 +406,13 @@ class Songs(ViewContainer):
class Playlist(ViewContainer):
def __init__(self, header_bar, selection_toolbar, player):
- ViewContainer.__init__(self, "Playlists", header_bar,
+ ViewContainer.__init__(self, _("Playlists"), header_bar,
selection_toolbar)
class Artists (ViewContainer):
def __init__(self, header_bar, selection_toolbar, player):
- ViewContainer.__init__(self, "Artists", header_bar,
+ ViewContainer.__init__(self, _("Artists"), header_bar,
selection_toolbar, True)
self.player = player
self._artists = {}
diff --git a/gnomemusic/widgets.py b/gnomemusic/widgets.py
index 3770edd..92102be 100644
--- a/gnomemusic/widgets.py
+++ b/gnomemusic/widgets.py
@@ -1,6 +1,7 @@
from gi.repository import Gtk, Gd, GLib, GObject, Grl, Pango
from gi.repository import GdkPixbuf
from gi.repository import Tracker
+from gettext import gettext as _
from gnomemusic.grilo import grilo
import logging
from gnomemusic.query import Query
@@ -24,7 +25,7 @@ class LoadMoreButton:
no_show_all=True)
self._spinner.set_size_request(16, 16)
child.add(self._spinner)
- self._label = Gtk.Label(label="Load More",
+ self._label = Gtk.Label(label=_("Load More"),
visible=True)
child.add(self._label)
self.widget = Gtk.Button(no_show_all=True,
@@ -34,7 +35,7 @@ class LoadMoreButton:
self._on_item_count_changed()
def _on_load_more_clicked(self, data=None):
- self._label.set_label("Loading...")
+ self._label.set_label(_("Loading..."))
self._spinner.show()
self._spinner.start()
@@ -44,7 +45,7 @@ class LoadMoreButton:
self.widget.set_visible(visible)
if visible:
- self._label.set_label("Load More")
+ self._label.set_label(_("Load More"))
self._spinner.stop()
self._spinner.hide()
@@ -393,7 +394,7 @@ class ArtistAlbums(Gtk.VBox):
class AllArtistsAlbums(ArtistAlbums):
def __init__(self, player):
- ArtistAlbums.__init__(self, "All Artists", [], player)
+ ArtistAlbums.__init__(self, _("All Artists"), [], player)
self._offset = 0
self.countQuery = Query.ALBUMS_COUNT
self._load_more = LoadMoreButton(self._get_remaining_item_count)
diff --git a/gnomemusic/window.py b/gnomemusic/window.py
index ce8ff8b..880799c 100644
--- a/gnomemusic/window.py
+++ b/gnomemusic/window.py
@@ -90,7 +90,7 @@ class Window(Gtk.ApplicationWindow):
#To revert to the No Music View when no songs are found
else:
self.views[0] = Views.Empty(self.toolbar, self.player)
- self._stack.add_titled(self.views[0], "Empty", "Empty")
+ self._stack.add_titled(self.views[0], _("Empty"), _("Empty"))
self.toolbar.set_state(ToolbarState.ALBUMS)
self.toolbar.header_bar.show()
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]