Bug 1694959 - Update copy for notifications permission panel. r=mconley,flod

Differential Revision: https://phabricator.services.mozilla.com/D107628
This commit is contained in:
prathikshaprasadsuman 2021-03-09 21:26:17 +00:00
Родитель f8f4fb14e3
Коммит 8101c15778
2 изменённых файлов: 42 добавлений и 21 удалений

Просмотреть файл

@ -639,13 +639,21 @@ persistentStorage.block.accesskey=B
persistentStorage.allowWithSite2=Allow %S to store data in persistent storage?
persistentStorage.remember=Remember this decision
webNotifications.allow=Allow Notifications
webNotifications.allow.accesskey=A
# Web notifications UI
# LOCALIZATION NOTE (alwaysBlock, block)
# The two button strings will never be shown at the same time, so
# it's okay for them to have the same access key
webNotifications.allow2=Allow
webNotifications.allow2.accesskey=A
webNotifications.notNow=Not Now
webNotifications.notNow.accesskey=n
webNotifications.never=Never Allow
webNotifications.never.accesskey=v
webNotifications.receiveFromSite2=Will you allow %S to send notifications?
webNotifications.alwaysBlock=Always Block
webNotifications.alwaysBlock.accesskey=B
webNotifications.block=Block
webNotifications.block.accesskey=B
webNotifications.receiveFromSite3=Allow %S to send notifications?
# Phishing/Malware Notification Bar.
# LOCALIZATION NOTE (notADeceptiveSite, notAnAttack)

Просмотреть файл

@ -1000,7 +1000,7 @@ DesktopNotificationPermissionPrompt.prototype = {
get message() {
return gBrowserBundle.formatStringFromName(
"webNotifications.receiveFromSite2",
"webNotifications.receiveFromSite3",
["<>"]
);
},
@ -1008,9 +1008,9 @@ DesktopNotificationPermissionPrompt.prototype = {
get promptActions() {
let actions = [
{
label: gBrowserBundle.GetStringFromName("webNotifications.allow"),
label: gBrowserBundle.GetStringFromName("webNotifications.allow2"),
accessKey: gBrowserBundle.GetStringFromName(
"webNotifications.allow.accesskey"
"webNotifications.allow2.accesskey"
),
action: SitePermissions.ALLOW,
scope: SitePermissions.SCOPE_PERSISTENT,
@ -1025,13 +1025,19 @@ DesktopNotificationPermissionPrompt.prototype = {
action: SitePermissions.BLOCK,
});
}
let isBrowserPrivate = PrivateBrowsingUtils.isBrowserPrivate(this.browser);
actions.push({
label: gBrowserBundle.GetStringFromName("webNotifications.never"),
accessKey: gBrowserBundle.GetStringFromName(
"webNotifications.never.accesskey"
),
label: isBrowserPrivate
? gBrowserBundle.GetStringFromName("webNotifications.block")
: gBrowserBundle.GetStringFromName("webNotifications.alwaysBlock"),
accessKey: isBrowserPrivate
? gBrowserBundle.GetStringFromName("webNotifications.block.accesskey")
: gBrowserBundle.GetStringFromName(
"webNotifications.alwaysBlock.accesskey"
),
action: SitePermissions.BLOCK,
scope: PrivateBrowsingUtils.isBrowserPrivate(this.browser)
scope: isBrowserPrivate
? SitePermissions.SCOPE_SESSION
: SitePermissions.SCOPE_PERSISTENT,
});
@ -1039,22 +1045,29 @@ DesktopNotificationPermissionPrompt.prototype = {
},
get postPromptActions() {
return [
let actions = [
{
label: gBrowserBundle.GetStringFromName("webNotifications.allow"),
label: gBrowserBundle.GetStringFromName("webNotifications.allow2"),
accessKey: gBrowserBundle.GetStringFromName(
"webNotifications.allow.accesskey"
"webNotifications.allow2.accesskey"
),
action: SitePermissions.ALLOW,
},
{
label: gBrowserBundle.GetStringFromName("webNotifications.never"),
accessKey: gBrowserBundle.GetStringFromName(
"webNotifications.never.accesskey"
),
action: SitePermissions.BLOCK,
},
];
let isBrowserPrivate = PrivateBrowsingUtils.isBrowserPrivate(this.browser);
actions.push({
label: isBrowserPrivate
? gBrowserBundle.GetStringFromName("webNotifications.block")
: gBrowserBundle.GetStringFromName("webNotifications.alwaysBlock"),
accessKey: isBrowserPrivate
? gBrowserBundle.GetStringFromName("webNotifications.block.accesskey")
: gBrowserBundle.GetStringFromName(
"webNotifications.alwaysBlock.accesskey"
),
action: SitePermissions.BLOCK,
});
return actions;
},
};