Bug 1830679 - Convert element.setAttribute(data-l10n-{id,args}) uses in the codebase to document.l10n.setAttributes(element, id, args) r=eemeli,Gijs,willdurand,extension-reviewers,settings-reviewers,search-reviewers,devtools-reviewers,fxview-reviewers,mconley,Standard8,jdescottes,kcochrane,tabbrowser-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D176791
This commit is contained in:
@@ -1940,7 +1940,7 @@ var CustomizableUIInternal = {
|
||||
}
|
||||
|
||||
if (aWidget.l10nId) {
|
||||
node.setAttribute("data-l10n-id", aWidget.l10nId);
|
||||
aDocument.l10n.setAttributes(node, aWidget.l10nId);
|
||||
if (button != node) {
|
||||
// This is probably a "button-and-view" widget, such as the Profiler
|
||||
// button. In that case, "node" is the "toolbaritem" container, and
|
||||
@@ -1948,7 +1948,7 @@ var CustomizableUIInternal = {
|
||||
// In this case, the values on the "node" is used in the Customize
|
||||
// view, as well as the tooltips over both buttons; the values on the
|
||||
// "button" are used in the overflow menu.
|
||||
button.setAttribute("data-l10n-id", aWidget.l10nId);
|
||||
aDocument.l10n.setAttributes(button, aWidget.l10nId);
|
||||
}
|
||||
|
||||
if (shortcut) {
|
||||
@@ -4837,7 +4837,7 @@ export var CustomizableUI = {
|
||||
// Sentence case in the AppMenu / panels.
|
||||
let l10nId = menuChild.getAttribute("appmenu-data-l10n-id");
|
||||
if (l10nId) {
|
||||
subviewItem.setAttribute("data-l10n-id", l10nId);
|
||||
doc.l10n.setAttributes(subviewItem, l10nId);
|
||||
}
|
||||
|
||||
fragment.appendChild(subviewItem);
|
||||
|
||||
@@ -457,7 +457,7 @@ if (Services.prefs.getBoolPref("identity.fxaccounts.enabled")) {
|
||||
? "syncing-data-l10n-id"
|
||||
: "sync-now-data-l10n-id"
|
||||
);
|
||||
syncNowBtn.setAttribute("data-l10n-id", l10nId);
|
||||
doc.l10n.setAttributes(syncNowBtn, l10nId);
|
||||
|
||||
let SyncedTabsPanelList = doc.defaultView.SyncedTabsPanelList;
|
||||
panelview.syncedTabsPanelList = new SyncedTabsPanelList(
|
||||
|
||||
@@ -644,7 +644,7 @@ const PanelUI = {
|
||||
// their localization IDs are set on "appmenu-data-l10n-id" attributes.
|
||||
let l10nId = node.getAttribute("appmenu-data-l10n-id");
|
||||
if (l10nId) {
|
||||
button.setAttribute("data-l10n-id", l10nId);
|
||||
document.l10n.setAttributes(button, l10nId);
|
||||
}
|
||||
|
||||
if (node.id) {
|
||||
|
||||
Reference in New Issue
Block a user