Bug 905933 - Improve plural form for AndXMoreFiles string, r=enndeakin

This commit is contained in:
Theo Chevalier 2013-08-20 11:18:03 +02:00
parent 4d5863d1fe
commit 23ef27ee11
2 changed files with 10 additions and 7 deletions

View File

@ -28,8 +28,11 @@ NoFilesSelected=No files selected.
# %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

View File

@ -590,11 +590,11 @@
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;
}
}