[sushi] all: import Gettext.gettext as "_" and use it



commit 5b6f8985dee786387b052bb0bce76f00f0eb405c
Author: Cosimo Cecchi <cosimoc gnome org>
Date:   Tue May 10 13:32:39 2011 -0400

    all: import Gettext.gettext as "_" and use it
    
    For code clarity and consistency with the GNOME style.

 src/js/ui/fallbackRenderer.js |   17 +++++++++--------
 src/js/viewers/audio.js       |    7 +++++--
 src/js/viewers/evince.js      |    2 +-
 src/js/viewers/folder.js      |   13 +++++++------
 4 files changed, 22 insertions(+), 17 deletions(-)
---
diff --git a/src/js/ui/fallbackRenderer.js b/src/js/ui/fallbackRenderer.js
index d4a0c9f..dee6099 100644
--- a/src/js/ui/fallbackRenderer.js
+++ b/src/js/ui/fallbackRenderer.js
@@ -1,8 +1,9 @@
 let Gtk = imports.gi.Gtk;
-let Gettext = imports.gettext.domain("sushi");
-
 let Sushi = imports.gi.Sushi;
 
+let Gettext = imports.gettext.domain("sushi");
+let _ = Gettext.gettext;
+
 let Constants = imports.util.constants;
 let Utils = imports.ui.utils;
 
@@ -85,18 +86,18 @@ FallbackRenderer.prototype = {
             + "</big></b>";
 
         let typeStr =
-            "<small><b>" + Gettext.gettext("Type") + "  </b>" +
-            ((this._fileLoader.contentType) ? (this._fileLoader.contentType) : (Gettext.gettext("Loading...")))
+            "<small><b>" + _("Type") + "  </b>" +
+            ((this._fileLoader.contentType) ? (this._fileLoader.contentType) : (_("Loading...")))
              + "</small>";
 
         let sizeStr =
-            "<small><b>" + Gettext.gettext("Size") + "  </b>" +
-            ((this._fileLoader.size) ? (this._fileLoader.size) : (Gettext.gettext("Loading...")))
+            "<small><b>" + _("Size") + "  </b>" +
+            ((this._fileLoader.size) ? (this._fileLoader.size) : (_("Loading...")))
              + "</small>";
 
         let dateStr =
-            "<small><b>" + Gettext.gettext("Modified") + "  </b>" +
-             ((this._fileLoader.time) ? (this._fileLoader.time) : (Gettext.gettext("Loading...")))
+            "<small><b>" + _("Modified") + "  </b>" +
+             ((this._fileLoader.time) ? (this._fileLoader.time) : (_("Loading...")))
              + "</small>";
 
         this._titleLabel.set_markup(titleStr);
diff --git a/src/js/viewers/audio.js b/src/js/viewers/audio.js
index ea207d3..bb47253 100644
--- a/src/js/viewers/audio.js
+++ b/src/js/viewers/audio.js
@@ -2,6 +2,9 @@ let MimeHandler = imports.ui.mimeHandler;
 let Gst = imports.gi.Gst;
 let Gio = imports.gi.Gio;
 
+let Gettext = imports.gettext.domain("sushi");
+let _ = Gettext.gettext;
+
 let Constants = imports.util.constants;
 
 function AudioRenderer(args) {
@@ -121,9 +124,9 @@ AudioRenderer.prototype = {
         }
 
         if (albumName)
-            this._albumLabel.set_markup("<small><i>from  </i>" + albumName + "</small>");
+            this._albumLabel.set_markup("<small><i>" + _("from") + "  </i>" + albumName + "</small>");
         if (artistName)
-            this._authorLabel.set_markup("<small><i>by  </i><b>" + artistName + "</b></small>");
+            this._authorLabel.set_markup("<small><i>" + _("by") + "  </i><b>" + artistName + "</b></small>");
 
         this._titleLabel.set_markup("<b>" + titleName + "</b>");
 
diff --git a/src/js/viewers/evince.js b/src/js/viewers/evince.js
index 87cd3ff..896b191 100644
--- a/src/js/viewers/evince.js
+++ b/src/js/viewers/evince.js
@@ -42,7 +42,7 @@ EvinceRenderer.prototype = {
         this._spinnerBox.pack_start(spinner, true, true, 0);
 
         let label = new Gtk.Label();
-        label.set_text(Gettext.gettext("Loading..."));
+        label.set_text(_("Loading..."));
         label.show();
         this._spinnerBox.pack_start(label, true, true, 0);
 
diff --git a/src/js/viewers/folder.js b/src/js/viewers/folder.js
index 61182e8..42101f5 100644
--- a/src/js/viewers/folder.js
+++ b/src/js/viewers/folder.js
@@ -1,9 +1,10 @@
 let MimeHandler = imports.ui.mimeHandler;
 let Gtk = imports.gi.Gtk;
-let Gettext = imports.gettext.domain("sushi");
-
 let Sushi = imports.gi.Sushi;
 
+let Gettext = imports.gettext.domain("sushi");
+let _ = Gettext.gettext;
+
 let Constants = imports.util.constants;
 let Utils = imports.ui.utils;
 
@@ -88,13 +89,13 @@ FolderRenderer.prototype = {
             "<b><big>" + name + "</big></b>";
 
         let sizeStr =
-            "<small><b>" + Gettext.gettext("Size") + "  </b>" +
-            ((this._folderLoader.size) ? (this._folderLoader.size) : (Gettext.gettext("Loading...")))
+            "<small><b>" + _("Size") + "  </b>" +
+            ((this._folderLoader.size) ? (this._folderLoader.size) : (_("Loading...")))
              + "</small>";
 
         let dateStr =
-            "<small><b>" + Gettext.gettext("Modified") + "  </b>" +
-             ((this._folderLoader.time) ? (this._folderLoader.time) : (Gettext.gettext("Loading...")))
+            "<small><b>" + _("Modified") + "  </b>" +
+             ((this._folderLoader.time) ? (this._folderLoader.time) : (_("Loading...")))
              + "</small>";
 
         this._titleLabel.set_markup(titleStr);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]