Bug 1118226 - Allow to add number to string for removing selected cookies to improve localizability. r=dao
authorSebastian Hengst <archaeopteryx@coole-files.de>
Wed, 07 Jan 2015 12:40:29 +0100
changeset 248529 28fe6535d5fb5efe3bc168a575baf555ca0824d3
parent 248528 c5feceed953a427ccfe93790543f66ca02b59a10
child 248530 c8cc5b44f8981f56927a35b5a81ead655afce14a
push id4489
push userraliiev@mozilla.com
push dateMon, 23 Feb 2015 15:17:55 +0000
treeherdermozilla-beta@fd7c3dc24146 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
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 1118226 - Allow to add number to string for removing selected cookies to improve localizability. r=dao
--- a/browser/components/preferences/cookies.js
+++ b/browser/components/preferences/cookies.js
@@ -550,17 +550,18 @@ var gCookiesWindow = {
     var item = this._view._getItemAtIndex(seln.currentIndex);
     if (item && seln.count == 1 && item.container && item.open)
       selectedCookieCount += 2;
     let buttonLabel = this._bundle.getString("removeSelectedCookies");
     let removeSelectedCookies = document.getElementById("removeSelectedCookies");
-    removeSelectedCookies.label = PluralForm.get(selectedCookieCount, buttonLabel);
+    removeSelectedCookies.label = PluralForm.get(selectedCookieCount, buttonLabel)
+                                            .replace("#1", selectedCookieCount);
     removeSelectedCookies.disabled = !(seln.count > 0);
   performDeletion: function gCookiesWindow_performDeletion(deleteItems) {
     var psvc = Components.classes["@mozilla.org/preferences-service;1"]
     var blockFutureCookies = false;
--- a/browser/locales/en-US/chrome/browser/preferences/cookies.dtd
+++ b/browser/locales/en-US/chrome/browser/preferences/cookies.dtd
@@ -2,16 +2,20 @@
    - License, v. 2.0. If a copy of the MPL was not distributed with this
    - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
 <!ENTITY window.width                       "36em">
 <!ENTITY     cookiesonsystem.label          "The following cookies are stored on your computer:">
 <!ENTITY     cookiename.label               "Cookie Name">
 <!ENTITY     cookiedomain.label             "Site"> 
+<!-- LOCALIZATION NOTE (button.removeSelectedCookies.accesskey):
+  The label associated with this accesskey can be found in 
+  preferences.properties as removeSelectedCookies.
 <!ENTITY     button.removeSelectedCookies.accesskey "R">
 <!ENTITY     button.removeAllCookies.label "Remove All">
 <!ENTITY     button.removeAllCookies.accesskey "A">
 <!ENTITY     props.name.label               "Name:">
 <!ENTITY     props.value.label              "Content:">
 <!ENTITY     props.domain.label             "Host:">
 <!ENTITY     props.path.label               "Path:">
--- a/browser/locales/en-US/chrome/browser/preferences/preferences.properties
+++ b/browser/locales/en-US/chrome/browser/preferences/preferences.properties
@@ -90,16 +90,20 @@ canAccessFirstParty=Allow first party on
 canSession=Allow for Session
 noCookieSelected=<no cookie selected>
 cookiesAll=The following cookies are stored on your computer:
 cookiesFiltered=The following cookies match your search:
 # LOCALIZATION NOTE (removeSelectedCookies):
 # Semicolon-separated list of plural forms. See:
 # http://developer.mozilla.org/en/docs/Localization_and_Plurals
+# If you need to display the number of selected elements in your language,
+# you can use #1 in your localization as a placeholder for the number.
+# For example this is the English string with numbers:   
+# removeSelectedCookied=Remove #1 Selected;Remove #1 Selected
 removeSelectedCookies=Remove Selected;Remove Selected
 #### Offline apps
 offlineAppRemoveTitle=Remove offline website data
 offlineAppRemovePrompt=After removing this data, %S will not be available offline.  Are you sure you want to remove this offline website?
 offlineAppRemoveConfirm=Remove offline data