Bug 905933 - Improve plural form for AndXMoreFiles string, r=enndeakin
authorTheo Chevalier <theo.chevalier11@gmail.com>
Tue, 20 Aug 2013 11:18:03 +0200
changeset 156184 2cec08a1b9332166951c807b1600eecded8abb14
parent 156183 c1a70c4645724603dc73ccf92756b56092e7d2e7
child 156185 a90744bf61988eac52056b8dbd53b9b8001490cb
push id2961
push userlsblakk@mozilla.com
push dateMon, 28 Oct 2013 21:59:28 +0000
treeherdermozilla-beta@73ef4f13486f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersenndeakin
bugs905933
milestone26.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 905933 - Improve plural form for AndXMoreFiles string, r=enndeakin
dom/locales/en-US/chrome/layout/HtmlForm.properties
toolkit/content/widgets/popup.xml
--- a/dom/locales/en-US/chrome/layout/HtmlForm.properties
+++ b/dom/locales/en-US/chrome/layout/HtmlForm.properties
@@ -23,13 +23,16 @@ NoFileSelected=No file selected.
 # LOCALIZATION NOTE (NoFilesSelected): this string is shown on a
 # <input type='file' multiple> when there is no file selected yet.
 NoFilesSelected=No files selected.
 # LOCALIZATION NOTE (XFilesSelected): this string is shown on a
 # <input type='file' multiple> when there are more than one selected file.
 # %S will be a number greater or equal to 2.
 XFilesSelected=%S files selected.
 ColorPicker=Choose a color
-# LOCALIZATION NOTE (AndXMoreFiles): this string is shown at the end of the
-# tooltip text for <input type='file' multiple> when there are more than 21
-# files selected (when we will only list the first 20, plus an "and X more"
-# line). %S will be the number of files minus 20. 
-AndXMoreFiles=and %S more
+# LOCALIZATION NOTE (AndNMoreFiles): Semi-colon list of plural forms. 
+# See: http://developer.mozilla.org/en/docs/Localization_and_Plurals 
+# This string is shown at the end of the tooltip text for <input type='file'
+# multiple> when there are more than 21 files selected (when we will only list
+# the first 20, plus an "and X more" line). #1 represents the number of files
+# minus 20 and will always be a number equal to or greater than 2. So the
+# singular case will never be used.
+AndNMoreFiles=and one more;and #1 more
--- a/toolkit/content/widgets/popup.xml
+++ b/toolkit/content/widgets/popup.xml
@@ -585,21 +585,21 @@
                 const TRUNCATED_FILE_COUNT = 20;
                 let count = Math.min(files.length, TRUNCATED_FILE_COUNT);
                 for (let i = 1; i < count; ++i) {
                   titleText += "\n" + files[i].name;
                 }
                 if (files.length == TRUNCATED_FILE_COUNT + 1) {
                   titleText += "\n" + files[TRUNCATED_FILE_COUNT].name;
                 } else if (files.length > TRUNCATED_FILE_COUNT + 1) {
-                  let xmoreStr = bundle.GetStringFromName("AndXMoreFiles");
+                  let xmoreStr = bundle.GetStringFromName("AndNMoreFiles");
                   let xmoreNum = files.length - TRUNCATED_FILE_COUNT;
                   let tmp = {};
                   Components.utils.import("resource://gre/modules/PluralForm.jsm", tmp);
-                  let andXMoreStr = tmp.PluralForm.get(xmoreNum, xmoreStr).replace("%S", xmoreNum);
+                  let andXMoreStr = tmp.PluralForm.get(xmoreNum, xmoreStr).replace("#1", xmoreNum);
                   titleText += "\n" + andXMoreStr;
                 }
               }
             } catch(e) {}
           }
 
           while ((titleText == null) && (XLinkTitleText == null) &&
                  (SVGTitleText == null) && tipElement) {