Bug 586685 - Pull out hard coded strings for localization [r=dietrich a=blocking-b6]
authorMichael Yoshitaka Erlewine <mitcho@mitcho.com>
Thu, 09 Sep 2010 10:06:00 -0400
changeset 52324 0d41af6784f79f06c3f7d737e846aa8850118e57
parent 52323 bb18c5b7fa5857589ba0d3e258d2b717b997bb77
child 52325 4b50cff14c740a535ff30481ba078d8789fa69c1
push id1
push userroot
push dateTue, 26 Apr 2011 22:38:44 +0000
treeherdermozilla-beta@bfdb6e623a36 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdietrich, blocking-b6
bugs586685
milestone2.0b6pre
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 586685 - Pull out hard coded strings for localization [r=dietrich a=blocking-b6]
browser/base/content/tabview/groupitems.js
browser/base/content/tabview/tabview.js
browser/base/content/tabview/ui.js
browser/locales/en-US/chrome/browser/tabview.properties
browser/locales/jar.mn
--- a/browser/base/content/tabview/groupitems.js
+++ b/browser/base/content/tabview/groupitems.js
@@ -125,18 +125,17 @@ function GroupItem(listOfEls, options) {
     .appendTo("body");
 
   // ___ New Tab Button
   this.$ntb = iQ("<div>")
     .addClass('newTabButton')
     .click(function() {
       self.newTab();
     })
-    .attr('title',
-          "New tab")
+    .attr('title', tabviewString('groupItem.newTabButton'))
     .appendTo($container);
 
   // ___ Resizer
   this.$resizer = iQ("<div>")
     .addClass('resizer')
     .appendTo($container)
     .hide();
 
@@ -291,17 +290,17 @@ function GroupItem(listOfEls, options) {
   }
 };
 
 // ----------
 GroupItem.prototype = Utils.extend(new Item(), new Subscribable(), {
   // ----------
   // Variable: defaultName
   // The prompt text for the title field.
-  defaultName: "Name this tab group…",
+  defaultName: tabviewString('groupItem.defaultName'),
 
   // -----------
   // Function: setActiveTab
   // Sets the active <TabItem> for this groupItem
   setActiveTab: function GroupItem_setActiveTab(tab) {
     Utils.assert(tab && tab.isATabItem, 'tab must be a TabItem');
     this._activeTab = tab;
   },
@@ -1739,16 +1738,18 @@ let GroupItems = {
       UI.showTabView();
     }
   },
 
   // ----------
   // Function: killNewTabGroup
   // Removes the New Tab Group, which is now defunct. See bug 575851 and comments therein.
   killNewTabGroup: function GroupItems_killNewTabGroup() {
+    // not localized as the original "New Tabs" group title was never localized
+    // to begin with
     let newTabGroupTitle = "New Tabs";
     this.groupItems.forEach(function(groupItem) {
       if (groupItem.getTitle() == newTabGroupTitle && groupItem.locked.title) {
         groupItem.removeAll();
         groupItem.close();
       }
     });
   }
--- a/browser/base/content/tabview/tabview.js
+++ b/browser/base/content/tabview/tabview.js
@@ -20,16 +20,23 @@ XPCOMUtils.defineLazyGetter(this, "gBrow
 XPCOMUtils.defineLazyGetter(this, "gTabViewDeck", function() {
   return gWindow.document.getElementById("tab-view-deck");
 });
 
 XPCOMUtils.defineLazyGetter(this, "gTabViewFrame", function() {
   return gWindow.document.getElementById("tab-view");
 });
 
+XPCOMUtils.defineLazyGetter(this, "tabviewBundle", function() {
+  return Services.strings.
+    createBundle("chrome://browser/locale/tabview.properties");
+});
+
+function tabviewString(name) tabviewBundle.GetStringFromName('tabview.' + name);
+
 # NB: Certain files need to evaluate before others
 
 #include iq.js
 #include storage.js
 #include items.js
 #include groupitems.js
 #include tabitems.js
 #include drag.js
--- a/browser/base/content/tabview/ui.js
+++ b/browser/base/content/tabview/ui.js
@@ -158,17 +158,17 @@ let UI = {
 
       // ___ tabs
       TabItems.init();
       TabItems.pausePainting();
 
       if (firstTime) {
         var padding = 10;
         var infoWidth = 350;
-        var infoHeight = 350;
+        var infoHeight = 232;
         var pageBounds = Items.getPageBounds();
         pageBounds.inset(padding, padding);
 
         // ___ make a fresh groupItem
         var box = new Rect(pageBounds);
         box.width =
           Math.min(box.width * 0.667, pageBounds.width - (infoWidth + padding));
         box.height = box.height * 0.667;
@@ -182,25 +182,20 @@ let UI = {
         items.forEach(function(item) {
           if (item.parent)
             item.parent.remove(item);
 
           groupItem.add(item);
         });
 
         // ___ make info item
-        let welcome = "How to organize your tabs";
-        let more = "";
         let video = "http://videos-cdn.mozilla.net/firefox4beta/tabcandy_howto.webm";
         var html =
           "<div class='intro'>"
-            + "<h1>" + welcome + "</h1>"
-            + ( more && more.length ? "<div>" + more + "</div><br>" : "")
-            + "<video src='" + video + "' "
-            + "width='100%' preload controls>"
+            + "<video src='" + video + "' width='100%' preload controls>"
           + "</div>";
 
         box.left = box.right + padding;
         box.width = infoWidth;
         box.height = infoHeight;
         var infoItem = new InfoItem(box);
         infoItem.html(html);
       }
new file mode 100644
--- /dev/null
+++ b/browser/locales/en-US/chrome/browser/tabview.properties
@@ -0,0 +1,2 @@
+tabview.groupItem.newTabButton=New tab
+tabview.groupItem.defaultName=Name this tab group…
--- a/browser/locales/jar.mn
+++ b/browser/locales/jar.mn
@@ -27,16 +27,17 @@
     locale/browser/search.properties               (%chrome/browser/search.properties)
     locale/browser/searchbar.dtd                   (%chrome/browser/searchbar.dtd)
     locale/browser/engineManager.dtd               (%chrome/browser/engineManager.dtd)
     locale/browser/engineManager.properties        (%chrome/browser/engineManager.properties)
     locale/browser/setDesktopBackground.dtd        (%chrome/browser/setDesktopBackground.dtd)
     locale/browser/shellservice.properties         (%chrome/browser/shellservice.properties)
     locale/browser/tabbrowser.dtd                  (%chrome/browser/tabbrowser.dtd)
     locale/browser/tabbrowser.properties           (%chrome/browser/tabbrowser.properties)
+    locale/browser/tabview.properties              (%chrome/browser/tabview.properties)
     locale/browser/taskbar.properties              (%chrome/browser/taskbar.properties)
     locale/browser/places/places.dtd               (%chrome/browser/places/places.dtd)
     locale/browser/places/places.properties        (%chrome/browser/places/places.properties)
     locale/browser/places/editBookmarkOverlay.dtd  (%chrome/browser/places/editBookmarkOverlay.dtd)
     locale/browser/places/bookmarkProperties.properties (%chrome/browser/places/bookmarkProperties.properties)
     locale/browser/preferences/selectBookmark.dtd  (%chrome/browser/preferences/selectBookmark.dtd)
     locale/browser/places/moveBookmarks.dtd        (%chrome/browser/places/moveBookmarks.dtd)
 #ifdef MOZ_SAFE_BROWSING