Bug 1196395 - No plurals form for context menus when multiple pages are selected in Library. r=mak
authorPavan <pavankarthikboddeda@gmail.com>
Wed, 21 Dec 2016 10:06:00 +0100
changeset 326899 620c1f06766b9f68f666e235ed41557ce333927a
parent 326898 66bfbd8e40887d04a4fe0661216695ff28077cce
child 326900 31c11875a3653b74939b44980d50bb6c05386d46
push id85068
push usercbook@mozilla.com
push dateThu, 22 Dec 2016 14:03:28 +0000
treeherdermozilla-inbound@620c1f06766b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmak
bugs1196395
milestone53.0a1
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 1196395 - No plurals form for context menus when multiple pages are selected in Library. r=mak
browser/components/places/content/controller.js
browser/components/places/content/placesOverlay.xul
browser/locales/en-US/chrome/browser/places/places.dtd
browser/locales/en-US/chrome/browser/places/places.properties
--- a/browser/components/places/content/controller.js
+++ b/browser/components/places/content/controller.js
@@ -650,16 +650,26 @@ PlacesController.prototype = {
             openContainerInTabsItem.disabled = true;
             // Ensure that we don't display the menu if nothing is enabled:
             usableItemCount--;
           }
         }
       }
     }
 
+    // Make sure correct PluralForms are diplayed when multiple pages are selected.
+    var deleteHistoryItem = document.getElementById("placesContext_delete_history");
+    deleteHistoryItem.label = PlacesUIUtils.getPluralString("cmd.deletePages.label",
+                                                            metadata.length);
+    deleteHistoryItem.accessKey = PlacesUIUtils.getString("cmd.deletePages.accesskey");
+    var createBookmarkItem = document.getElementById("placesContext_createBookmark");
+    createBookmarkItem.label = PlacesUIUtils.getPluralString("cmd.bookmarkPages.label",
+                                                             metadata.length);
+    createBookmarkItem.accessKey = PlacesUIUtils.getString("cmd.bookmarkPages.accesskey");
+
     return usableItemCount > 0;
   },
 
   /**
    * Select all links in the current view.
    */
   selectAll: function PC_selectAll() {
     this._view.selectAll();
--- a/browser/components/places/content/placesOverlay.xul
+++ b/browser/components/places/content/placesOverlay.xul
@@ -156,18 +156,16 @@
               label="&cmd.new_separator.label;"
               accesskey="&cmd.new_separator.accesskey;"
               closemenu="single"
               selectiontype="any"
               hideifnoinsertionpoint="true"/>
     <menuseparator id="placesContext_newSeparator"/>
     <menuitem id="placesContext_createBookmark"
               command="placesCmd_createBookmark"
-              label="&cmd.bookmarkLink.label;"
-              accesskey="&cmd.bookmarkLink.accesskey;"
               selection="link"
               forcehideselection="bookmark|tagChild"/>
     <menuitem id="placesContext_cut"
               command="placesCmd_cut"
               label="&cutCmd.label;"
               accesskey="&cutCmd.accesskey;" 
               closemenu="single"
               selection="bookmark|folder|separator|query"
@@ -189,18 +187,16 @@
     <menuitem id="placesContext_delete"
               command="placesCmd_delete"
               label="&deleteCmd.label;"
               accesskey="&deleteCmd.accesskey;"
               closemenu="single"
               selection="bookmark|tagChild|folder|query|dynamiccontainer|separator|host"/>
     <menuitem id="placesContext_delete_history"
               command="placesCmd_delete"
-              label="&cmd.delete.label;"
-              accesskey="&cmd.delete.accesskey;"
               closemenu="single"
               selection="link"
               forcehideselection="bookmark"/>
     <menuitem id="placesContext_deleteHost"
               command="placesCmd_deleteDataHost"
               label="&cmd.deleteDomainData.label;"
               accesskey="&cmd.deleteDomainData.accesskey;"
               closemenu="single"
--- a/browser/locales/en-US/chrome/browser/places/places.dtd
+++ b/browser/locales/en-US/chrome/browser/places/places.dtd
@@ -36,20 +36,16 @@
 
 <!ENTITY cmd.backup.label               "Backup…">
 <!ENTITY cmd.backup.accesskey           "B">
 <!ENTITY cmd.restore2.label             "Restore">
 <!ENTITY cmd.restore2.accesskey         "R">
 <!ENTITY cmd.restoreFromFile.label      "Choose File…">
 <!ENTITY cmd.restoreFromFile.accesskey  "C">
 
-<!ENTITY cmd.bookmarkLink.label         "Bookmark This Page…">
-<!ENTITY cmd.bookmarkLink.accesskey     "B">
-<!ENTITY cmd.delete.label               "Delete This Page">
-<!ENTITY cmd.delete.accesskey           "D">
 <!ENTITY cmd.deleteDomainData.label     "Forget About This Site">
 <!ENTITY cmd.deleteDomainData.accesskey "F">
 
 <!ENTITY cmd.open.label                  "Open">
 <!ENTITY cmd.open.accesskey              "O">
 <!ENTITY cmd.open_window.label           "Open in a New Window">
 <!ENTITY cmd.open_window.accesskey       "N">
 <!ENTITY cmd.open_private_window.label     "Open in a New Private Window">
--- a/browser/locales/en-US/chrome/browser/places/places.properties
+++ b/browser/locales/en-US/chrome/browser/places/places.properties
@@ -85,8 +85,18 @@ searchengineResultLabel=Search
 
 
 # LOCALIZATION NOTE (lockPrompt.text)
 # %S will be replaced with the application name.
 lockPrompt.title=Browser Startup Error
 lockPrompt.text=The bookmarks and history system will not be functional because one of %S’s files is in use by another application. Some security software can cause this problem.
 lockPromptInfoButton.label=Learn More
 lockPromptInfoButton.accessKey=L
+
+# LOCALIZATION NOTE (deletePagesLabel): Semi-colon list of plural forms.
+# See: http://developer.mozilla.org/en/docs/Localization_and_Plurals
+cmd.deletePages.label=Delete Page;Delete Pages
+cmd.deletePages.accesskey=D
+
+# LOCALIZATION NOTE (bookmarkPagesLabel): Semi-colon list of plural forms.
+# See: http://developer.mozilla.org/en/docs/Localization_and_Plurals
+cmd.bookmarkPages.label=Bookmark Page;Bookmark Pages
+cmd.bookmarkPages.accesskey=B