[gnome-shell] Add initial calls to Gettext



commit ca51a8c926be8e0c268ba3d87dcde5411df630f2
Author: Colin Walters <walters verbum org>
Date:   Fri Aug 14 09:30:48 2009 -0400

    Add initial calls to Gettext
    
    We don't have a lot of strings, and what ones we do have we've
    been avoiding duplication.  This patch adds calls to _() i.e. gettext
    for those strings we do have.

 js/ui/appDisplay.js |    4 +++-
 js/ui/dash.js       |   16 +++++++++-------
 js/ui/panel.js      |    7 +++++--
 js/ui/runDialog.js  |    4 +++-
 js/ui/widget.js     |    9 ++++++---
 5 files changed, 26 insertions(+), 14 deletions(-)
---
diff --git a/js/ui/appDisplay.js b/js/ui/appDisplay.js
index 906c45f..bee50ce 100644
--- a/js/ui/appDisplay.js
+++ b/js/ui/appDisplay.js
@@ -11,6 +11,8 @@ const Shell = imports.gi.Shell;
 const Lang = imports.lang;
 const Signals = imports.signals;
 const Mainloop = imports.mainloop;
+const Gettext = imports.gettext.domain('gnome-shell');
+const _ = Gettext.gettext;
 
 const DND = imports.ui.dnd;
 const GenericDisplay = imports.ui.genericDisplay;
@@ -311,7 +313,7 @@ AppDisplay.prototype = {
 
     _redisplayMenus: function() {
         this._menuDisplay.remove_all();
-        this._addMenuItem('Frequent', null, 'gtk-select-all');
+        this._addMenuItem(_("Frequent"), null, 'gtk-select-all');
         for (let i = 0; i < this._menus.length; i++) {
             let menu = this._menus[i];
             this._addMenuItem(menu.name, menu.id, menu.icon, i+1);
diff --git a/js/ui/dash.js b/js/ui/dash.js
index 4028c8d..0a32a97 100644
--- a/js/ui/dash.js
+++ b/js/ui/dash.js
@@ -8,6 +8,8 @@ const Pango = imports.gi.Pango;
 const Shell = imports.gi.Shell;
 const Signals = imports.signals;
 const Lang = imports.lang;
+const Gettext = imports.gettext.domain('gnome-shell');
+const _ = Gettext.gettext;
 
 const AppDisplay = imports.ui.appDisplay;
 const DocDisplay = imports.ui.docDisplay;
@@ -230,7 +232,7 @@ SearchEntry.prototype = {
                                    border_color: SEARCH_BORDER_BOTTOM_COLOR });
         this.pane = null;
 
-        this._defaultText = "Find apps or documents";
+        this._defaultText = _("Find apps or documents");
 
         let textProperties = { font_name: "Sans 12" };
         let entryProperties = { editable: true,
@@ -331,7 +333,7 @@ MoreLink.prototype = {
 
         let text = new Clutter.Text({ font_name: "Sans 12px",
                                       color: BRIGHT_TEXT_COLOR,
-                                      text: "Browse" });
+                                      text: _("Browse") });
         this.actor.append(text, Big.BoxPackFlags.NONE);
 
         this.actor.connect('button-press-event', Lang.bind(this, function (b, e) {
@@ -467,12 +469,12 @@ Dash.prototype = {
                 this._searchPane = new ResultPane(this);
                 this._searchPane.content.append(new Clutter.Text({ color: TEXT_COLOR,
                                                                    font_name: 'Sans Bold 10px',
-                                                                   text: "APPLICATIONS" }),
+                                                                   text: _("APPLICATIONS") }),
                                                  Big.BoxPackFlags.NONE);
                 this._searchAreaApps = this._searchPane.packResults(AppDisplay.AppDisplay, false);
                 this._searchPane.content.append(new Clutter.Text({ color: TEXT_COLOR,
                                                                    font_name: 'Sans Bold 10px',
-                                                                   text: "RECENT DOCUMENTS" }),
+                                                                   text: _("RECENT DOCUMENTS") }),
                                                  Big.BoxPackFlags.NONE);
                 this._searchAreaDocs = this._searchPane.packResults(DocDisplay.DocDisplay, false);
                 this._addPane(this._searchPane);
@@ -540,7 +542,7 @@ Dash.prototype = {
 
         /***** Applications *****/
 
-        let appsSection = new Section("APPLICATIONS");
+        let appsSection = new Section(_("APPLICATIONS"));
         let appWell = new AppDisplay.AppWell();
         appsSection.content.append(appWell.actor, Big.BoxPackFlags.EXPAND);
 
@@ -558,14 +560,14 @@ Dash.prototype = {
 
         /***** Places *****/
 
-        let placesSection = new Section("PLACES", true);
+        let placesSection = new Section(_("PLACES"), true);
         let placesDisplay = new Places.Places();
         placesSection.content.append(placesDisplay.actor, Big.BoxPackFlags.EXPAND);
         this.sectionArea.append(placesSection.actor, Big.BoxPackFlags.NONE);
 
         /***** Documents *****/
 
-        let docsSection = new Section("RECENT DOCUMENTS");
+        let docsSection = new Section(_("RECENT DOCUMENTS"));
 
         let docDisplay = new DocDisplay.DocDisplay();
         docDisplay.load();
diff --git a/js/ui/panel.js b/js/ui/panel.js
index c919ada..97b21d6 100644
--- a/js/ui/panel.js
+++ b/js/ui/panel.js
@@ -9,6 +9,8 @@ const Meta = imports.gi.Meta;
 const Shell = imports.gi.Shell;
 const Tweener = imports.ui.tweener;
 const Signals = imports.signals;
+const Gettext = imports.gettext.domain('gnome-shell');
+const _ = Gettext.gettext;
 
 const Button = imports.ui.button;
 const Main = imports.ui.main;
@@ -261,7 +263,7 @@ Panel.prototype = {
 
         /* left side */
 
-        this.button = new Button.Button("Activities", PANEL_BUTTON_COLOR, PRESSED_BUTTON_BACKGROUND_COLOR,
+        this.button = new Button.Button(_("Activities"), PANEL_BUTTON_COLOR, PRESSED_BUTTON_BACKGROUND_COLOR,
                                         PANEL_FOREGROUND_COLOR, true, DEFAULT_FONT);
         this.button.button.height = PANEL_HEIGHT;
 
@@ -406,7 +408,8 @@ Panel.prototype = {
             displayDate.setMinutes(displayDate.getMinutes() + 1);
             msecRemaining += 60000;
         }
-        this._clock.set_text(displayDate.toLocaleFormat("%a %l:%M %p"));
+        /* Translators: This is a time format.  */
+        this._clock.set_text(displayDate.toLocaleFormat(_("%a %l:%M %p")));
         Mainloop.timeout_add(msecRemaining, Lang.bind(this, this._updateClock));
         return false;
     },
diff --git a/js/ui/runDialog.js b/js/ui/runDialog.js
index becac0a..5ba561b 100644
--- a/js/ui/runDialog.js
+++ b/js/ui/runDialog.js
@@ -6,6 +6,8 @@ const Lang = imports.lang;
 const Mainloop = imports.mainloop;
 const Shell = imports.gi.Shell;
 const Signals = imports.signals;
+const Gettext = imports.gettext.domain('gnome-shell');
+const _ = Gettext.gettext;
 
 const Main = imports.ui.main;
 
@@ -69,7 +71,7 @@ RunDialog.prototype = {
 
         let label = new Clutter.Text({ color: BOX_TEXT_COLOR,
                                        font_name: '18px Sans',
-                                       text: 'Please enter a command:' });
+                                       text: _("Please enter a command:") });
         label.set_position(6, 6);
         boxGroup.add_actor(label);
 
diff --git a/js/ui/widget.js b/js/ui/widget.js
index b33028a..4ec371f 100644
--- a/js/ui/widget.js
+++ b/js/ui/widget.js
@@ -9,6 +9,8 @@ const Lang = imports.lang;
 const Pango = imports.gi.Pango;
 const Shell = imports.gi.Shell;
 const Signals = imports.signals;
+const Gettext = imports.gettext.domain('gnome-shell');
+const _ = Gettext.gettext;
 
 const DocInfo = imports.misc.docInfo;
 
@@ -156,7 +158,8 @@ ClockWidget.prototype = {
     },
 
     _updateText: function(time) {
-        this.actor.set_text(time.toLocaleFormat("%H:%M"));
+        // Translators: This is a time format.
+        this.actor.set_text(time.toLocaleFormat(_("%H:%M")));
     },
 
     _updateCairo: function(time) {
@@ -311,7 +314,7 @@ AppsWidget.prototype = {
     _init : function() {
         Widget.prototype._init.apply(this, arguments);
 
-        this.title = "Applications";
+        this.title = _("Applications");
         this.actor = new Big.Box({ spacing: 2 });
         this.collapsedActor = new Big.Box({ spacing: 2});
 
@@ -336,7 +339,7 @@ RecentDocsWidget.prototype = {
     _init : function() {
         Widget.prototype._init.apply(this, arguments);
 
-        this.title = "Recent Documents";
+        this.title = _("Recent Documents");
         this.actor = new Big.Box({ spacing: 2 });
 
         this._recentManager = Gtk.RecentManager.get_default();



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