Bug 600141 - Sync UI: Fix PluralForm for Sync Strings (additionalClients.label and friends). r=Pike a=blocking-beta7

This commit is contained in:
Philipp von Weitershausen 2010-09-28 19:19:43 +02:00
parent 6e5069e696
commit 8460478501
2 changed files with 20 additions and 8 deletions

View File

@ -744,10 +744,12 @@ var gSyncSetup = {
if (stm.step())
daysOfHistory = stm.getInt32(0);
// Support %S for historical reasons (see bug 600141)
document.getElementById("historyCount").value =
PluralForm.get(daysOfHistory,
this._stringBundle.GetStringFromName("historyDaysCount.label"))
.replace("%S", daysOfHistory);
.replace("%S", daysOfHistory)
.replace("#1", daysOfHistory);
// bookmarks
let bookmarks = 0;
@ -759,17 +761,21 @@ var gSyncSetup = {
stm.params.tag = Weave.Svc.Bookmark.tagsFolder;
if (stm.executeStep())
bookmarks = stm.row.bookmarks;
// Support %S for historical reasons (see bug 600141)
document.getElementById("bookmarkCount").value =
PluralForm.get(bookmarks,
this._stringBundle.GetStringFromName("bookmarksCount.label"))
.replace("%S", bookmarks);
.replace("%S", bookmarks)
.replace("#1", bookmarks);
// passwords
let logins = Weave.Svc.Login.getAllLogins({});
// Support %S for historical reasons (see bug 600141)
document.getElementById("passwordCount").value =
PluralForm.get(logins.length,
this._stringBundle.GetStringFromName("passwordsCount.label"))
.replace("%S", logins.length);
.replace("%S", logins.length)
.replace("#1", logins.length);
this._case1Setup = true;
break;
case 2:
@ -794,10 +800,12 @@ var gSyncSetup = {
appendNode(name);
}
if (count > 5) {
// Support %S for historical reasons (see bug 600141)
let label =
PluralForm.get(count - 5,
this._stringBundle.GetStringFromName("additionalClientCount.label"))
.replace("%S", count - 5);
.replace("%S", count - 5)
.replace("#1", count - 5);
appendNode(label);
}
this._case2Setup = true;

View File

@ -11,19 +11,23 @@ verifying.label = Verifying…
# LOCALIZATION NOTE (additionalClientCount.label):
# Semi-colon list of plural forms. See:
# http://developer.mozilla.org/en/docs/Localization_and_Plurals
additionalClientCount.label = and %S additional device;and %S additional devices
# #1 is the number of additional clients (was %S for a short while, use #1 instead, even if both work)
additionalClientCount.label = and #1 additional device;and #1 additional devices
# LOCALIZATION NOTE (bookmarksCount.label):
# Semi-colon list of plural forms. See:
# http://developer.mozilla.org/en/docs/Localization_and_Plurals
bookmarksCount.label = %S bookmark;%S bookmarks
# #1 is the number of bookmarks (was %S for a short while, use #1 instead, even if both work)
bookmarksCount.label = #1 bookmark;#1 bookmarks
# LOCALIZATION NOTE (historyDaysCount.label):
# Semi-colon list of plural forms. See:
# http://developer.mozilla.org/en/docs/Localization_and_Plurals
historyDaysCount.label = %S day of history;%S days of history
# #1 is the number of days (was %S for a short while, use #1 instead, even if both work)
historyDaysCount.label = #1 day of history;#1 days of history
# LOCALIZATION NOTE (passwordsCount.label):
# Semi-colon list of plural forms. See:
# http://developer.mozilla.org/en/docs/Localization_and_Plurals
passwordsCount.label = %S password;%S passwords
# #1 is the number of passwords (was %S for a short while, use #1 instead, even if both work)
passwordsCount.label = #1 password;#1 passwords
save.synckey.title = Save Sync Key