Bug 853126 - Use PluralForm for the blocked popup message on Android [r=margaret]

This commit is contained in:
Matt Brubeck 2013-03-22 15:27:59 -07:00
parent 9e027eb9f1
commit 89d45f5fc2
2 changed files with 7 additions and 7 deletions

View File

@ -5155,14 +5155,12 @@ var PopupBlockerObserver = {
if (!browser.pageReport.reported) {
if (Services.prefs.getBoolPref("privacy.popups.showBrowserMessage")) {
let brandShortName = Strings.brand.GetStringFromName("brandShortName");
let message;
let popupCount = browser.pageReport.length;
let strings = Strings.browser;
if (popupCount > 1)
message = strings.formatStringFromName("popup.warningMultiple", [brandShortName, popupCount], 2);
else
message = strings.formatStringFromName("popup.warning", [brandShortName], 1);
let message = PluralForm.get(popupCount, strings.GetStringFromName("popup.message"))
.replace("#1", brandShortName)
.replace("#2", popupCount);
let buttons = [
{

View File

@ -44,8 +44,10 @@ notificationRestart.blocked=Unsafe add-ons installed. Restart to disable.
notificationRestart.button=Restart
# Popup Blocker
popup.warning=%S prevented this site from opening a pop-up window. Would you like to show it?
popup.warningMultiple=%S prevented this site from opening %S pop-up windows. Would you like to show them?
# LOCALIZATION NOTE (popup.message): Semicolon-separated list of plural forms.
# #1 is brandShortName and #2 is the number of pop-ups blocked.
popup.message=#1 prevented this site from opening a pop-up window. Would you like to show it?;#1 prevented this site from opening #2 pop-up windows. Would you like to show them?
popup.dontAskAgain=Don't ask again for this site
popup.show=Show
popup.dontShow=Don't show