Bug 1581185 - Migrate pageActionContextMenu in browser.xhtml to Fluent. r=fluent-reviewers,bgrins,flod

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

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Zibi Braniecki 2019-09-18 16:53:54 +00:00
parent ccb7771759
commit f421461cc8
4 changed files with 48 additions and 13 deletions

View File

@ -569,21 +569,21 @@
<menupopup id="pageActionContextMenu"
onpopupshowing="BrowserPageActions.onContextMenuShowing(event, this);">
<menuitem class="pageActionContextMenuItem builtInUnpinned"
label="&pageAction.addToUrlbar.label;"
oncommand="BrowserPageActions.togglePinningForContextAction();"/>
oncommand="BrowserPageActions.togglePinningForContextAction();"
data-l10n-id="page-action-add-to-urlbar"/>
<menuitem class="pageActionContextMenuItem builtInPinned"
label="&pageAction.removeFromUrlbar.label;"
oncommand="BrowserPageActions.togglePinningForContextAction();"/>
oncommand="BrowserPageActions.togglePinningForContextAction();"
data-l10n-id="page-action-remove-from-urlbar"/>
<menuitem class="pageActionContextMenuItem extensionUnpinned"
label="&pageAction.addToUrlbar.label;"
oncommand="BrowserPageActions.togglePinningForContextAction();"/>
oncommand="BrowserPageActions.togglePinningForContextAction();"
data-l10n-id="page-action-add-to-urlbar"/>
<menuitem class="pageActionContextMenuItem extensionPinned"
label="&pageAction.removeFromUrlbar.label;"
oncommand="BrowserPageActions.togglePinningForContextAction();"/>
oncommand="BrowserPageActions.togglePinningForContextAction();"
data-l10n-id="page-action-remove-from-urlbar"/>
<menuseparator class="pageActionContextMenuItem extensionPinned extensionUnpinned"/>
<menuitem class="pageActionContextMenuItem extensionPinned extensionUnpinned"
label="&pageAction.manageExtension.label;"
oncommand="BrowserPageActions.openAboutAddonsForContextAction();"/>
oncommand="BrowserPageActions.openAboutAddonsForContextAction();"
data-l10n-id="page-action-manage-extension"/>
</menupopup>
#include ../../components/places/content/bookmarksHistoryTooltip.inc.xul

View File

@ -47,3 +47,12 @@ urlbar-persistent-storage-notification-anchor =
.tooltiptext = Store data in Persistent Storage
urlbar-addons-notification-anchor =
.tooltiptext = Open add-on installation message panel
## Page Action Context Menu
page-action-add-to-urlbar =
.label = Add to Address Bar
page-action-manage-extension =
.label = Manage Extension…
page-action-remove-from-urlbar =
.label = Remove from Address Bar

View File

@ -794,9 +794,6 @@ you can use these alternative items. Otherwise, their values should be empty. -
<!ENTITY tabHideControlled.disableButton.accesskey "D">
<!ENTITY pageActionButton.tooltip "Page actions">
<!ENTITY pageAction.addToUrlbar.label "Add to Address Bar">
<!ENTITY pageAction.removeFromUrlbar.label "Remove from Address Bar">
<!ENTITY pageAction.manageExtension.label "Manage Extension…">
<!ENTITY sendToDevice.syncNotReady.label "Syncing Devices…">

View File

@ -0,0 +1,29 @@
# coding=utf8
# Any copyright is dedicated to the Public Domain.
# http://creativecommons.org/publicdomain/zero/1.0/
from __future__ import absolute_import
import fluent.syntax.ast as FTL
from fluent.migrate.helpers import transforms_from
from fluent.migrate.helpers import MESSAGE_REFERENCE, TERM_REFERENCE, VARIABLE_REFERENCE
from fluent.migrate import COPY, CONCAT, REPLACE
def migrate(ctx):
"""Bug 1581185 - Migrate the pageActionContextMenu to FTL, part {index}."""
ctx.add_transforms(
'browser/browser/browser.ftl',
'browser/browser/browser.ftl',
transforms_from(
"""
page-action-add-to-urlbar =
.label = { COPY("browser/chrome/browser/browser.dtd", "pageAction.addToUrlbar.label") }
page-action-manage-extension =
.label = { COPY("browser/chrome/browser/browser.dtd", "pageAction.manageExtension.label") }
page-action-remove-from-urlbar =
.label = { COPY("browser/chrome/browser/browser.dtd", "pageAction.removeFromUrlbar.label") }
"""
)
)