Bug 1798761 - Fix localization for update banner labels in AppMenu. r=aleca

The AppMenu now has a banner across the top with various updater status messages.
The strings are missing though. The code that refers to the strings is from bug 1621841.
They're DTD strings however and it doesn't make sense to add those.
Add them as Fluent strings and update the associated JS to display them to
align with Firefox as done in bug 1706650.

Differential Revision: https://phabricator.services.mozilla.com/D161067

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Rob Lemley 2022-11-03 22:23:29 +00:00
Родитель 833d2b8822
Коммит 97ce027cd6
3 изменённых файлов: 33 добавлений и 10 удалений

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

@ -21,10 +21,6 @@
class="panel-subview-body">
<vbox id="appMenu-addon-banners"/>
<toolbarbutton class="panel-banner-item"
label-update-available="updateAvailable.panelUI.label"
label-update-manual="updateManual.panelUI.label"
label-update-unsupported="updateUnsupported.panelUI.label"
label-update-restart="updateRestart.panelUI.label2"
oncommand="PanelUI._onBannerItemSelected(event)"
wrap="true"
hidden="true"/>

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

@ -706,16 +706,25 @@ const PanelUI = {
// "Banner item" here refers to an item in the hamburger panel menu. They will
// typically show up as a colored row in the panel.
_showBannerItem(notification) {
const supportedIds = [
"update-downloading",
"update-available",
"update-manual",
"update-unsupported",
"update-restart",
];
if (!supportedIds.includes(notification.id)) {
return;
}
if (!this._panelBannerItem) {
this._panelBannerItem = this.mainView.querySelector(".panel-banner-item");
}
let label = this._panelBannerItem.getAttribute("label-" + notification.id);
// Ignore items we don't know about.
if (!label) {
return;
}
let l10nId = "appmenuitem-banner-" + notification.id;
document.l10n.setAttributes(this._panelBannerItem, l10nId);
this._panelBannerItem.setAttribute("notificationid", notification.id);
this._panelBannerItem.setAttribute("label", label);
this._panelBannerItem.hidden = false;
this._panelBannerItem.notification = notification;
},

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

@ -233,3 +233,21 @@ appmenu-help-troubleshooting-info =
appmenu-help-about-product =
.label = About { -brand-short-name }
.accesskey = A
## Application Update
appmenuitem-banner-update-downloading =
.label = Downloading { -brand-shorter-name } update
appmenuitem-banner-update-available =
.label = Update available — download now
appmenuitem-banner-update-manual =
.label = Update available — download now
appmenuitem-banner-update-unsupported =
.label = Unable to update — system incompatible
appmenuitem-banner-update-restart =
.label = Update available — restart now