Bug 1523761 - Move the syncedTabs strings from browser.dtd to fluent, r=Gijs,flod

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

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Yuan Cheng 2019-03-15 18:46:46 +00:00
Родитель 7feefb5c15
Коммит ad8f4def53
6 изменённых файлов: 146 добавлений и 72 удалений

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

@ -637,31 +637,23 @@
onpopupshowing="UpdateDynamicShortcutTooltipText(this);"/>
<menupopup id="SyncedTabsSidebarContext">
<menuitem label="&syncedTabs.context.open.label;"
accesskey="&syncedTabs.context.open.accesskey;"
<menuitem data-l10n-id="synced-tabs-context-open"
id="syncedTabsOpenSelected" where="current"/>
<menuitem label="&syncedTabs.context.openInNewTab.label;"
accesskey="&syncedTabs.context.openInNewTab.accesskey;"
<menuitem data-l10n-id="synced-tabs-context-open-in-new-tab"
id="syncedTabsOpenSelectedInTab" where="tab"/>
<menuitem label="&syncedTabs.context.openInNewWindow.label;"
accesskey="&syncedTabs.context.openInNewWindow.accesskey;"
<menuitem data-l10n-id="synced-tabs-context-open-in-new-window"
id="syncedTabsOpenSelectedInWindow" where="window"/>
<menuitem label="&syncedTabs.context.openInNewPrivateWindow.label;"
accesskey="&syncedTabs.context.openInNewPrivateWindow.accesskey;"
<menuitem data-l10n-id="synced-tabs-context-open-in-new-private-window"
id="syncedTabsOpenSelectedInPrivateWindow" where="window" private="true"/>
<menuseparator/>
<menuitem label="&syncedTabs.context.bookmarkSingleTab.label;"
accesskey="&syncedTabs.context.bookmarkSingleTab.accesskey;"
<menuitem data-l10n-id="synced-tabs-context-bookmark-single-tab"
id="syncedTabsBookmarkSelected"/>
<menuitem label="&syncedTabs.context.copy.label;"
accesskey="&syncedTabs.context.copy.accesskey;"
<menuitem data-l10n-id="synced-tabs-context-copy"
id="syncedTabsCopySelected"/>
<menuseparator/>
<menuitem label="&syncedTabs.context.openAllInTabs.label;"
accesskey="&syncedTabs.context.openAllInTabs.accesskey;"
<menuitem data-l10n-id="synced-tabs-context-open-all-in-tabs"
id="syncedTabsOpenAllInTabs"/>
<menuitem label="&syncedTabs.context.managedevices.label;"
accesskey="&syncedTabs.context.managedevices.accesskey;"
<menuitem data-l10n-id="synced-tabs-context-manage-devices"
id="syncedTabsManageDevices"
oncommand="gSync.openDevicesManagementPage('syncedtabs-sidebar');"/>
<menuitem label="&syncSyncNowItem.label;"

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

@ -16,6 +16,7 @@ var syncedTabsDeckComponent = new SyncedTabsDeckComponent({window, SyncedTabs, f
let themeListener;
let onLoaded = () => {
window.top.MozXULElement.insertFTLIfNeeded("browser/syncedTabs.ftl");
themeListener = new LightweightThemeChild({
content: window,
chromeOuterWindowID: window.top.windowUtils.outerWindowID,

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

@ -5,14 +5,6 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" [
<!ENTITY % browserDTD SYSTEM "chrome://browser/locale/browser.dtd">
%browserDTD;
<!ENTITY % globalDTD
SYSTEM "chrome://global/locale/global.dtd">
%globalDTD;
<!ENTITY % syncBrandDTD
SYSTEM "chrome://browser/locale/syncBrand.dtd">
%syncBrandDTD;
]>
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
@ -25,10 +17,12 @@
<link rel="stylesheet" type="text/css" media="all" href="chrome://global/skin/"/>
<link rel="stylesheet" type="text/css" media="all" href="chrome://global/skin/textbox.css"/>
<link rel="stylesheet" type="text/css" media="all" href="chrome://browser/content/browser.css"/>
<title>&syncedTabs.sidebar.label;</title>
<link rel="localization" href="browser/branding/sync-brand.ftl"/>
<link rel="localization" href="browser/syncedTabs.ftl"/>
<title data-l10n-id="synced-tabs-sidebar-title"></title>
</head>
<body dir="&locale.dir;" role="application">
<body role="application">
<template id="client-template">
<div class="item client" role="option" tabindex="-1">
<div class="item-title-container">
@ -50,7 +44,7 @@
<div class="item empty" role="option" tabindex="-1">
<div class="item-title-container">
<div class="item-icon-container"></div>
<p class="item-title">&syncedTabs.sidebar.notabs.label;</p>
<p class="item-title" data-l10n-id="synced-tabs-sidebar-notabs"></p>
</div>
</div>
</div>
@ -78,28 +72,28 @@
</div>
<div class="notAuthedInfo sync-state">
<div class="syncIllustration"></div>
<p class="instructions">&syncedTabs.sidebar.notsignedin.label;</p>
<button class="button sync-prefs">&fxaSignIn.label;</button>
<p class="instructions" data-l10n-id="synced-tabs-sidebar-notsignedin"></p>
<button class="button sync-prefs" data-l10n-id="fxa-sign-in"></button>
</div>
<div class="reauth sync-state">
<div class="syncIllustrationIssue"></div>
<p class="instructions">&syncedTabs.sidebar.notsignedin.label;</p>
<button class="button sync-prefs">&fxaSignIn.label;</button>
<p class="instructions" data-l10n-id="synced-tabs-sidebar-notsignedin"></p>
<button class="button sync-prefs" data-l10n-id="fxa-sign-in"></button>
</div>
<div class="unverified sync-state">
<div class="syncIllustrationIssue"></div>
<p class="instructions">&syncedTabs.sidebar.unverified.label;</p>
<button class="button sync-prefs">&syncedTabs.sidebar.openprefs.label;</button>
<p class="instructions" data-l10n-id="synced-tabs-sidebar-unverified"></p>
<button class="button sync-prefs" data-l10n-id="synced-tabs-sidebar-openprefs"></button>
</div>
<div class="singleDeviceInfo sync-state">
<div class="syncIllustrationIssue"></div>
<p class="instructions">&syncedTabs.sidebar.noclients.subtitle;</p>
<button class="button connect-device">&syncedTabs.sidebar.connectAnotherDevice;</button>
<p class="instructions" data-l10n-id="synced-tabs-sidebar-noclients-subtitle"></p>
<button class="button connect-device" data-l10n-id="synced-tabs-sidebar-connect-another-device"></button>
</div>
<div class="tabs-disabled sync-state">
<div class="syncIllustrationIssue"></div>
<p class="instructions">&syncedTabs.sidebar.tabsnotsyncing.label;</p>
<button class="button sync-prefs">&syncedTabs.sidebar.openprefs.label;</button>
<p class="instructions" data-l10n-id="synced-tabs-sidebar-tabsnotsyncing"></p>
<button class="button sync-prefs" data-l10n-id="synced-tabs-sidebar-openprefs"></button>
</div>
</div>
</template>
@ -112,7 +106,7 @@
<div class="textbox-input-box">
<input type="text"
class="tabsFilter textbox-input"
placeholder="&syncedTabs.sidebar.searchPlaceholder;"
data-l10n-id="synced-tabs-sidebar-search"
tabindex="1"/>
<div class="textbox-search-icons">
<a class="textbox-search-clear"></a>

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

@ -0,0 +1,39 @@
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
synced-tabs-sidebar-title = Synced Tabs
synced-tabs-sidebar-noclients-subtitle = Want to see your tabs from other devices here?
synced-tabs-sidebar-notsignedin = Sign in to view a list of tabs from your other devices.
synced-tabs-sidebar-unverified = Your account needs to be verified.
synced-tabs-sidebar-notabs = No open tabs
synced-tabs-sidebar-openprefs = Open { -sync-brand-short-name } Preferences
synced-tabs-sidebar-tabsnotsyncing = Turn on tab syncing to view a list of tabs from your other devices.
synced-tabs-sidebar-connect-another-device = Connect Another Device
synced-tabs-sidebar-search =
.placeholder = Search synced tabs
synced-tabs-context-open =
.label = Open
.accesskey = O
synced-tabs-context-open-in-new-tab =
.label = Open in a New Tab
.accesskey = w
synced-tabs-context-open-in-new-window =
.label = Open in a New Window
.accesskey = N
synced-tabs-context-open-in-new-private-window =
.label = Open in a New Private Window
.accesskey = P
synced-tabs-context-bookmark-single-tab =
.label = Bookmark This Tab…
.accesskey = B
synced-tabs-context-copy =
.label = Copy
.accesskey = C
synced-tabs-context-open-all-in-tabs =
.label = Open All in Tabs
.accesskey = O
synced-tabs-context-manage-devices =
.label = Manage Devices…
.accesskey = D
fxa-sign-in = Sign in to { -sync-brand-short-name }

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

@ -913,40 +913,6 @@ you can use these alternative items. Otherwise, their values should be empty. -
<!ENTITY syncTabsMenu3.label "Synced Tabs">
<!ENTITY syncedTabs.sidebar.label "Synced Tabs">
<!ENTITY syncedTabs.sidebar.noclients.label "Sign in to Firefox from your other devices to view their tabs here.">
<!ENTITY syncedTabs.sidebar.noclients.subtitle "Want to see your tabs from other devices here?">
<!ENTITY syncedTabs.sidebar.notsignedin.label "Sign in to view a list of tabs from your other devices.">
<!ENTITY syncedTabs.sidebar.unverified.label "Your account needs to be verified.">
<!ENTITY syncedTabs.sidebar.notabs.label "No open tabs">
<!ENTITY syncedTabs.sidebar.openprefs.label "Open &syncBrand.shortName.label; Preferences">
<!-- LOCALIZATION NOTE (syncedTabs.sidebar.tabsnotsyncing.label): This is shown
when Sync is configured but syncing tabs is disabled. -->
<!ENTITY syncedTabs.sidebar.tabsnotsyncing.label "Turn on tab syncing to view a list of tabs from your other devices.">
<!ENTITY syncedTabs.sidebar.searchPlaceholder "Search synced tabs">
<!ENTITY syncedTabs.sidebar.connectAnotherDevice "Connect Another Device">
<!-- LOCALIZATION NOTE (syncedTabs.context.open.accesskey,
syncedTabs.context.openAllInTabs.accesskey):
These access keys are identical because their associated menu items are
mutually exclusive -->
<!ENTITY syncedTabs.context.open.label "Open">
<!ENTITY syncedTabs.context.open.accesskey "O">
<!ENTITY syncedTabs.context.openInNewTab.label "Open in a New Tab">
<!ENTITY syncedTabs.context.openInNewTab.accesskey "w">
<!ENTITY syncedTabs.context.openInNewWindow.label "Open in a New Window">
<!ENTITY syncedTabs.context.openInNewWindow.accesskey "N">
<!ENTITY syncedTabs.context.openInNewPrivateWindow.label "Open in a New Private Window">
<!ENTITY syncedTabs.context.openInNewPrivateWindow.accesskey "P">
<!ENTITY syncedTabs.context.bookmarkSingleTab.label "Bookmark This Tab…">
<!ENTITY syncedTabs.context.bookmarkSingleTab.accesskey "B">
<!ENTITY syncedTabs.context.copy.label "Copy">
<!ENTITY syncedTabs.context.copy.accesskey "C">
<!ENTITY syncedTabs.context.openAllInTabs.label "Open All in Tabs">
<!ENTITY syncedTabs.context.openAllInTabs.accesskey "O">
<!ENTITY syncedTabs.context.managedevices.label "Manage Devices…">
<!ENTITY syncedTabs.context.managedevices.accesskey "D">
<!ENTITY syncBrand.shortName.label "Sync">

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

@ -0,0 +1,82 @@
# 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 import COPY
from fluent.migrate import REPLACE
from fluent.migrate.helpers import transforms_from
from fluent.migrate.helpers import TERM_REFERENCE
def migrate(ctx):
"""Bug 1523761 - Move the syncedTabs strings from browser.dtd to fluent, part {index}."""
ctx.add_transforms(
"browser/browser/syncedTabs.ftl",
"browser/browser/syncedTabs.ftl",
transforms_from(
"""
synced-tabs-sidebar-title = { COPY(from_path, "syncedTabs.sidebar.label") }
synced-tabs-sidebar-noclients-subtitle = { COPY(from_path, "syncedTabs.sidebar.noclients.subtitle") }
synced-tabs-sidebar-notsignedin = { COPY(from_path, "syncedTabs.sidebar.notsignedin.label") }
synced-tabs-sidebar-unverified = { COPY(from_path, "syncedTabs.sidebar.unverified.label") }
synced-tabs-sidebar-notabs = { COPY(from_path, "syncedTabs.sidebar.notabs.label") }
synced-tabs-sidebar-tabsnotsyncing = { COPY(from_path, "syncedTabs.sidebar.tabsnotsyncing.label") }
synced-tabs-sidebar-connect-another-device = { COPY(from_path, "syncedTabs.sidebar.connectAnotherDevice") }
synced-tabs-sidebar-search =
.placeholder = { COPY(from_path, "syncedTabs.sidebar.searchPlaceholder") }
synced-tabs-context-open =
.label = { COPY(from_path, "syncedTabs.context.open.label") }
.accesskey = { COPY(from_path, "syncedTabs.context.open.accesskey") }
synced-tabs-context-open-in-new-tab =
.label = { COPY(from_path, "syncedTabs.context.openInNewTab.label") }
.accesskey = { COPY(from_path, "syncedTabs.context.openInNewTab.accesskey") }
synced-tabs-context-open-in-new-window =
.label = { COPY(from_path, "syncedTabs.context.openInNewWindow.label") }
.accesskey = { COPY(from_path, "syncedTabs.context.openInNewWindow.accesskey") }
synced-tabs-context-open-in-new-private-window =
.label = { COPY(from_path, "syncedTabs.context.openInNewPrivateWindow.label") }
.accesskey = { COPY(from_path, "syncedTabs.context.openInNewPrivateWindow.accesskey") }
synced-tabs-context-bookmark-single-tab =
.label = { COPY(from_path, "syncedTabs.context.bookmarkSingleTab.label") }
.accesskey = { COPY(from_path, "syncedTabs.context.bookmarkSingleTab.accesskey") }
synced-tabs-context-copy =
.label = { COPY(from_path, "syncedTabs.context.copy.label") }
.accesskey = { COPY(from_path, "syncedTabs.context.copy.accesskey") }
synced-tabs-context-open-all-in-tabs =
.label = { COPY(from_path, "syncedTabs.context.openAllInTabs.label") }
.accesskey = { COPY(from_path, "syncedTabs.context.openAllInTabs.accesskey") }
synced-tabs-context-manage-devices =
.label = { COPY(from_path, "syncedTabs.context.managedevices.label") }
.accesskey = { COPY(from_path, "syncedTabs.context.managedevices.accesskey") }
""", from_path="browser/chrome/browser/browser.dtd")
)
ctx.add_transforms(
"browser/browser/syncedTabs.ftl",
"browser/browser/syncedTabs.ftl",
[
FTL.Message(
id=FTL.Identifier("fxa-sign-in"),
value=REPLACE(
"browser/chrome/browser/browser.dtd",
"fxaSignIn.label",
{
"&syncBrand.shortName.label;": TERM_REFERENCE("sync-brand-short-name"),
},
)
),
FTL.Message(
id=FTL.Identifier("synced-tabs-sidebar-openprefs"),
value=REPLACE(
"browser/chrome/browser/browser.dtd",
"syncedTabs.sidebar.openprefs.label",
{
"&syncBrand.shortName.label;": TERM_REFERENCE("sync-brand-short-name"),
},
)
),
]
)