Bug 553143 - Make it easier to view all add-ons (recommended and search results) [r=vingtetun]
authorMark Finkle <mfinkle@mozilla.com>
Fri, 19 Mar 2010 14:01:36 -0400
changeset 1387 8d5e3793e2507f00af65b9632fd77659d3114326
parent 1386 fb6942f2795388acf8c3c7742e3d685e43ae9d87
child 1388 c6e8869f861821e547b2f5ce6bd6bfce4a55dd24
push id1238
push usermfinkle@mozilla.com
push dateFri, 19 Mar 2010 18:01:50 +0000
reviewersvingtetun
bugs553143
Bug 553143 - Make it easier to view all add-ons (recommended and search results) [r=vingtetun]
chrome/content/extensions.js
locales/en-US/chrome/browser.properties
--- a/chrome/content/extensions.js
+++ b/chrome/content/extensions.js
@@ -599,19 +599,25 @@ var ExtensionsView = {
     }
 
     let formatter = Cc["@mozilla.org/toolkit/URLFormatterService;1"].getService(Ci.nsIURLFormatter);
 
     if (!aIsRecommended) {
       if (aTotalResults > aAddons.length) {
         let showmore = document.createElement("richlistitem");
         showmore.setAttribute("typeName", "showmore");
-        showmore.setAttribute("title", strings.getFormattedString("addonsSearchMore.label", [aTotalResults]));
-        showmore.setAttribute("description", strings.getFormattedString("addonsSearchMore.description", [aAddons.length]));
-  
+
+        let titleBase = strings.getString("addonsSearchMore.label");
+        let title = PluralForm.get(aTotalResults, titleBase).replace("#1", aTotalResults);
+        showmore.setAttribute("title", title);
+
+        let descBase = strings.getString("addonsSearchMore.description");
+        let desc = PluralForm.get(aAddons.length, descBase).replace("#1", aAddons.length);
+        showmore.setAttribute("description", desc);
+
         let url = gPrefService.getCharPref("extensions.getAddons.search.browseURL");
         url = url.replace(/%TERMS%/g, encodeURIComponent(this.searchBox.value));
         url = formatter.formatURL(url);
         showmore.setAttribute("url", url);
         this._list.appendChild(showmore);
       }
 
       this.displaySectionMessage("repo", null, strings.getString("addonsSearchSuccess2.button"), true);
--- a/locales/en-US/chrome/browser.properties
+++ b/locales/en-US/chrome/browser.properties
@@ -3,21 +3,29 @@ addonsLocalNone.label=No add-ons install
 addonsSearchStart.label=Searching for add-ons…
 addonsSearchStart.button=Cancel
 addonsSearchNone.search=No matches found
 addonsSearchNone.recommended=No recommended add-ons
 addonsSearchNone.button=Try Again
 addonsSearchFail.label=%S couldn't retrieve add-ons
 addonsSearchFail.button=OK
 addonsSearchSuccess2.button=Clear Search
-addonsSearchMore.label=Show all %S results
-addonsSearchMore.description=If these %S results aren't what you're looking for, try this
 addonsBrowseAll.label=Browse all add-ons
 addonsBrowseAll.description=addons.mozilla.org has many to explore
 
+# LOCALIZATION NOTE (addonsSearchMore.label): Semi-colon list of plural forms.
+# See: http://developer.mozilla.org/en/docs/Localization_and_Plurals
+# #1 total number of add-ons that match the search terms
+addonsSearchMore.label=Show result;Show all #1 results
+
+# LOCALIZATION NOTE (addonsSearchMore.description): Semi-colon list of plural forms.
+# See: http://developer.mozilla.org/en/docs/Localization_and_Plurals
+# #1 number of search results currently visible
+addonsSearchMore.description=If this result isn't what you're looking for, try this;If these #1 results aren't what you're looking for, try this
+
 addonsSearchEngine.description=Integrated Search
 
 addonsConfirmInstall.title=Installing Add-on
 addonsConfirmInstall.install=Install
 
 addonType.2=Extension
 addonType.4=Theme
 addonType.8=Locale