зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1419547 - Migrate the "Containers" section of Preferences to the new Localization API. r=flod,Gijs
MozReview-Commit-ID: IA3GFardEHs --HG-- extra : rebase_source : e052f13c44e58d9b1cb90c7bcc5e9bd795bfd43d extra : intermediate-source : 48060f354ac1b9be5a1b6a24668c35c33d8faa86 extra : source : 606cc17a4e1110223f4e81ee2a84e8e4b7cfc1fe
This commit is contained in:
Родитель
5f2293a835
Коммит
735a746866
|
@ -5,9 +5,22 @@
|
|||
ChromeUtils.import("resource://gre/modules/Services.jsm");
|
||||
ChromeUtils.import("resource://gre/modules/ContextualIdentityService.jsm");
|
||||
|
||||
const containersBundle = Services.strings.createBundle("chrome://browser/locale/preferences/containers.properties");
|
||||
/**
|
||||
* We want to set the window title immediately to prevent flickers.
|
||||
*/
|
||||
function setTitle() {
|
||||
let params = window.arguments[0] || {};
|
||||
|
||||
const HTMLNS = "http://www.w3.org/1999/xhtml";
|
||||
let winElem = document.documentElement;
|
||||
if (params.userContextId) {
|
||||
document.l10n.setAttributes(winElem, "containers-window-update", {
|
||||
name: params.identity.name
|
||||
});
|
||||
} else {
|
||||
document.l10n.setAttributes(winElem, "containers-window-new");
|
||||
}
|
||||
}
|
||||
setTitle();
|
||||
|
||||
let gContainersManager = {
|
||||
icons: [
|
||||
|
@ -45,10 +58,6 @@ let gContainersManager = {
|
|||
this.userContextId = aParams.userContextId || null;
|
||||
this.identity = aParams.identity;
|
||||
|
||||
if (aParams.windowTitle) {
|
||||
document.title = aParams.windowTitle;
|
||||
}
|
||||
|
||||
const iconWrapper = document.getElementById("iconWrapper");
|
||||
iconWrapper.appendChild(this.createIconButtons());
|
||||
|
||||
|
@ -61,28 +70,14 @@ let gContainersManager = {
|
|||
this.checkForm();
|
||||
}
|
||||
|
||||
this.setLabelsMinWidth();
|
||||
|
||||
// This is to prevent layout jank caused by the svgs and outlines rendering at different times
|
||||
document.getElementById("containers-content").removeAttribute("hidden");
|
||||
},
|
||||
|
||||
setLabelsMinWidth() {
|
||||
const labelMinWidth = containersBundle.GetStringFromName("containers.labelMinWidth");
|
||||
const labels = [
|
||||
document.getElementById("nameLabel"),
|
||||
document.getElementById("iconLabel"),
|
||||
document.getElementById("colorLabel")
|
||||
];
|
||||
for (let label of labels) {
|
||||
label.style.minWidth = labelMinWidth;
|
||||
}
|
||||
},
|
||||
|
||||
uninit() {
|
||||
},
|
||||
|
||||
// Check if name string as to if the form can be submitted
|
||||
// Check if name is provided to determine if the form can be submitted
|
||||
checkForm() {
|
||||
const name = document.getElementById("name");
|
||||
let btnApplyChanges = document.getElementById("btnApplyChanges");
|
||||
|
@ -109,8 +104,7 @@ let gContainersManager = {
|
|||
iconSwatch.setAttribute("selected", true);
|
||||
}
|
||||
|
||||
iconSwatch.setAttribute("label",
|
||||
containersBundle.GetStringFromName(`containers.${icon}.label`));
|
||||
document.l10n.setAttributes(iconSwatch, `containers-icon-${icon}`);
|
||||
let iconElement = document.createElement("hbox");
|
||||
iconElement.className = "userContext-icon";
|
||||
iconElement.setAttribute("data-identity-icon", icon);
|
||||
|
@ -138,8 +132,7 @@ let gContainersManager = {
|
|||
colorSwatch.setAttribute("selected", true);
|
||||
}
|
||||
|
||||
colorSwatch.setAttribute("label",
|
||||
containersBundle.GetStringFromName(`containers.${color}.label`));
|
||||
document.l10n.setAttributes(colorSwatch, `containers-color-${color}`);
|
||||
let iconElement = document.createElement("hbox");
|
||||
iconElement.className = "userContext-icon";
|
||||
iconElement.setAttribute("data-identity-icon", "circle");
|
||||
|
|
|
@ -7,44 +7,47 @@
|
|||
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
|
||||
<?xml-stylesheet href="chrome://browser/skin/preferences/containers.css" type="text/css"?>
|
||||
|
||||
<!DOCTYPE dialog SYSTEM "chrome://browser/locale/preferences/containers.dtd" >
|
||||
|
||||
<window id="ContainersDialog" class="windowDialog"
|
||||
windowtype="Browser:Permissions"
|
||||
title="&window.title;"
|
||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
|
||||
style="width: &window.width;;"
|
||||
data-l10n-attrs="title, style"
|
||||
onload="gContainersManager.onLoad();"
|
||||
onunload="gContainersManager.uninit();"
|
||||
persist="screenX screenY width height"
|
||||
onkeypress="gContainersManager.onWindowKeyPress(event);">
|
||||
|
||||
<link rel="localization" href="browser/preferences/containers.ftl"/>
|
||||
<script type="text/javascript" src="chrome://global/content/l10n.js"></script>
|
||||
|
||||
<script src="chrome://global/content/treeUtils.js"/>
|
||||
<script src="chrome://browser/content/preferences/containers.js"/>
|
||||
|
||||
<stringbundle id="bundlePreferences"
|
||||
src="chrome://browser/locale/preferences/preferences.properties"/>
|
||||
|
||||
<keyset>
|
||||
<key key="&windowClose.key;" modifiers="accel" oncommand="window.close();"/>
|
||||
<key data-l10n-id="containers-window-close" modifiers="accel" oncommand="window.close();"/>
|
||||
</keyset>
|
||||
|
||||
<vbox class="contentPane largeDialogContainer" flex="1" hidden="true" id="containers-content">
|
||||
<hbox align="start">
|
||||
<label id="nameLabel" control="name" accesskey="&name2.accesskey;">&name2.label;</label>
|
||||
<textbox id="name" placeholder="&name.placeholder;" flex="1" oninput="gContainersManager.checkForm();" />
|
||||
<label id="nameLabel" control="name"
|
||||
data-l10n-id="containers-name-label"
|
||||
data-l10n-attrs="style"/>
|
||||
<textbox id="name" data-l10n-id="containers-name-text" flex="1" oninput="gContainersManager.checkForm();" />
|
||||
</hbox>
|
||||
<hbox align="center" id="iconWrapper">
|
||||
<label id="iconLabel" control="icon" accesskey="&icon2.accesskey;">&icon2.label;</label>
|
||||
<label id="iconLabel" control="icon"
|
||||
data-l10n-id="containers-icon-label"
|
||||
data-l10n-attrs="style"/>
|
||||
</hbox>
|
||||
<hbox align="center" id="colorWrapper">
|
||||
<label id="colorLabel" control="color" accesskey="&color2.accesskey;">&color2.label;</label>
|
||||
<label id="colorLabel" control="color"
|
||||
data-l10n-id="containers-color-label"
|
||||
data-l10n-attrs="style"/>
|
||||
</hbox>
|
||||
</vbox>
|
||||
<vbox>
|
||||
<hbox class="actionButtons" align="right" flex="1">
|
||||
<button id="btnApplyChanges" disabled="true" oncommand="gContainersManager.onApplyChanges();" icon="save"
|
||||
label="&button.ok.label;" accesskey="&button.ok.accesskey;"/>
|
||||
data-l10n-id="containers-button-done"/>
|
||||
</hbox>
|
||||
</vbox>
|
||||
</window>
|
||||
|
|
|
@ -5,13 +5,6 @@
|
|||
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
|
||||
<!-- import-globals-from in-content/main.js -->
|
||||
|
||||
<!DOCTYPE overlay [
|
||||
<!ENTITY % brandDTD SYSTEM "chrome://branding/locale/brand.dtd">
|
||||
<!ENTITY % containersDTD SYSTEM "chrome://browser/locale/preferences/containers.dtd">
|
||||
%brandDTD;
|
||||
%containersDTD;
|
||||
]>
|
||||
|
||||
<bindings id="handlerBindings"
|
||||
xmlns="http://www.mozilla.org/xbl"
|
||||
xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
|
||||
|
@ -71,16 +64,7 @@
|
|||
<xul:label flex="1" crop="end" xbl:inherits="xbl:text=containerName,highlightable"/>
|
||||
</xul:hbox>
|
||||
<xul:hbox flex="1" align="right">
|
||||
<xul:button anonid="preferencesButton"
|
||||
label="&preferencesButton.label;"
|
||||
xbl:inherits="value=userContextId"
|
||||
oncommand="gContainersPane.onPreferenceCommand(event.originalTarget)">
|
||||
</xul:button>
|
||||
<xul:button anonid="removeButton"
|
||||
label="&removeButton.label;"
|
||||
xbl:inherits="value=userContextId"
|
||||
oncommand="gContainersPane.onRemoveCommand(event.originalTarget)">
|
||||
</xul:button>
|
||||
<children />
|
||||
</xul:hbox>
|
||||
</xul:hbox>
|
||||
</content>
|
||||
|
|
|
@ -7,8 +7,6 @@
|
|||
ChromeUtils.import("resource://gre/modules/AppConstants.jsm");
|
||||
ChromeUtils.import("resource://gre/modules/ContextualIdentityService.jsm");
|
||||
|
||||
const containersBundle = Services.strings.createBundle("chrome://browser/locale/preferences/containers.properties");
|
||||
|
||||
const defaultContainerIcon = "fingerprint";
|
||||
const defaultContainerColor = "blue";
|
||||
|
||||
|
@ -38,6 +36,18 @@ let gContainersPane = {
|
|||
item.setAttribute("containerColor", container.color);
|
||||
item.setAttribute("userContextId", container.userContextId);
|
||||
|
||||
let prefsButton = document.createElement("button");
|
||||
prefsButton.setAttribute("oncommand", "gContainersPane.onPreferenceCommand(event.originalTarget)");
|
||||
prefsButton.setAttribute("value", container.userContextId);
|
||||
document.l10n.setAttributes(prefsButton, "containers-preferences-button");
|
||||
item.appendChild(prefsButton);
|
||||
|
||||
let removeButton = document.createElement("button");
|
||||
removeButton.setAttribute("oncommand", "gContainersPane.onRemoveCommand(event.originalTarget)");
|
||||
removeButton.setAttribute("value", container.userContextId);
|
||||
document.l10n.setAttributes(removeButton, "containers-remove-button");
|
||||
item.appendChild(removeButton);
|
||||
|
||||
this._list.appendChild(item);
|
||||
}
|
||||
},
|
||||
|
@ -47,13 +57,12 @@ let gContainersPane = {
|
|||
|
||||
let count = ContextualIdentityService.countContainerTabs(userContextId);
|
||||
if (count > 0) {
|
||||
let bundlePreferences = document.getElementById("bundlePreferences");
|
||||
|
||||
let title = bundlePreferences.getString("removeContainerAlertTitle");
|
||||
let message = PluralForm.get(count, bundlePreferences.getString("removeContainerMsg"))
|
||||
.replace("#S", count);
|
||||
let okButton = bundlePreferences.getString("removeContainerOkButton");
|
||||
let cancelButton = bundlePreferences.getString("removeContainerButton2");
|
||||
let [title, message, okButton, cancelButton] = await document.l10n.formatValues([
|
||||
["containers-remove-alert-title"],
|
||||
["containers-remove-alert-msg", { count }],
|
||||
["containers-remove-ok-button"],
|
||||
["containers-remove-cancel-button"]
|
||||
]);
|
||||
|
||||
let buttonFlags = (Ci.nsIPrompt.BUTTON_TITLE_IS_STRING * Ci.nsIPrompt.BUTTON_POS_0) +
|
||||
(Ci.nsIPrompt.BUTTON_TITLE_IS_STRING * Ci.nsIPrompt.BUTTON_POS_1);
|
||||
|
@ -85,15 +94,12 @@ let gContainersPane = {
|
|||
icon: defaultContainerIcon,
|
||||
color: defaultContainerColor
|
||||
};
|
||||
let title;
|
||||
if (userContextId) {
|
||||
identity = ContextualIdentityService.getPublicIdentityFromId(userContextId);
|
||||
// This is required to get the translation string from defaults
|
||||
identity.name = ContextualIdentityService.getUserContextLabel(identity.userContextId);
|
||||
title = containersBundle.formatStringFromName("containers.updateContainerTitle", [identity.name], 1);
|
||||
}
|
||||
|
||||
const params = { userContextId, identity, windowTitle: title };
|
||||
const params = { userContextId, identity };
|
||||
gSubDialog.open("chrome://browser/content/preferences/containers.xul",
|
||||
null, params);
|
||||
}
|
||||
|
|
|
@ -10,14 +10,14 @@
|
|||
<hbox hidden="true"
|
||||
class="container-header-links"
|
||||
data-category="paneContainers">
|
||||
<label class="text-link" id="backContainersLink">&backLink2.label;</label>
|
||||
<label class="text-link" id="backContainersLink" data-l10n-id="containers-back-link"/>
|
||||
</hbox>
|
||||
|
||||
<hbox id="header-containers"
|
||||
class="header"
|
||||
hidden="true"
|
||||
data-category="paneContainers">
|
||||
<label class="header-name" flex="1">&paneContainers.title;</label>
|
||||
<label class="header-name" flex="1" data-l10n-id="containers-header"/>
|
||||
</hbox>
|
||||
|
||||
<!-- Containers -->
|
||||
|
@ -31,7 +31,7 @@
|
|||
</vbox>
|
||||
<vbox>
|
||||
<hbox flex="1">
|
||||
<button id="containersAdd" oncommand="gContainersPane.onAddButtonCommand();" accesskey="&addButton.accesskey;" label="&addButton.label;"/>
|
||||
<button id="containersAdd" oncommand="gContainersPane.onAddButtonCommand();" data-l10n-id="containers-add-button"/>
|
||||
</hbox>
|
||||
</vbox>
|
||||
</groupbox>
|
||||
|
|
|
@ -130,9 +130,10 @@
|
|||
<button id="browserContainersSettings"
|
||||
class="accessory-button"
|
||||
data-l10n-id="browser-containers-settings"
|
||||
searchkeywords="&addButton.label;
|
||||
&preferencesButton.label;
|
||||
&removeButton.label;"/>
|
||||
search-l10n-ids="containers-add-button.label,
|
||||
containers-preferences-button.label,
|
||||
containers-remove-button.label"
|
||||
/>
|
||||
</hbox>
|
||||
</hbox>
|
||||
</vbox>
|
||||
|
|
|
@ -41,8 +41,6 @@
|
|||
<!ENTITY % syncDTD SYSTEM "chrome://browser/locale/preferences/sync.dtd">
|
||||
<!ENTITY % securityDTD SYSTEM
|
||||
"chrome://browser/locale/preferences/security.dtd">
|
||||
<!ENTITY % containersDTD SYSTEM
|
||||
"chrome://browser/locale/preferences/containers.dtd">
|
||||
<!ENTITY % sanitizeDTD SYSTEM "chrome://browser/locale/sanitize.dtd">
|
||||
<!ENTITY % mainDTD SYSTEM "chrome://browser/locale/preferences/main.dtd">
|
||||
<!ENTITY % aboutHomeDTD SYSTEM "chrome://browser/locale/aboutHome.dtd">
|
||||
|
@ -70,7 +68,6 @@
|
|||
%syncBrandDTD;
|
||||
%syncDTD;
|
||||
%securityDTD;
|
||||
%containersDTD;
|
||||
%sanitizeDTD;
|
||||
%mainDTD;
|
||||
%aboutHomeDTD;
|
||||
|
|
|
@ -0,0 +1,102 @@
|
|||
# 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/.
|
||||
|
||||
containers-window-new =
|
||||
.title = Add New Container
|
||||
.style = width: 45em
|
||||
# Variables
|
||||
# $name (String) - Name of the container
|
||||
containers-window-update =
|
||||
.title = { $name } Container Preferences
|
||||
.style = width: 45em
|
||||
|
||||
containers-window-close =
|
||||
.key = w
|
||||
|
||||
# This is a term to store style to be applied
|
||||
# on the three labels in the containers add/edit dialog:
|
||||
# - name
|
||||
# - icon
|
||||
# - color
|
||||
#
|
||||
# Using this term and referencing it in the `.style` attribute
|
||||
# of the three messages ensures that all three labels
|
||||
# will be aligned correctly.
|
||||
-containers-labels-style = min-width: 4rem
|
||||
|
||||
containers-name-label = Name
|
||||
.accesskey = N
|
||||
.style = { -containers-labels-style }
|
||||
|
||||
containers-name-text =
|
||||
.placeholder = Enter a container name
|
||||
|
||||
containers-icon-label = Icon
|
||||
.accesskey = I
|
||||
.style = { -containers-labels-style }
|
||||
|
||||
containers-color-label = Color
|
||||
.accesskey = o
|
||||
.style = { -containers-labels-style }
|
||||
|
||||
containers-button-done =
|
||||
.label = Done
|
||||
.accesskey = D
|
||||
|
||||
containers-remove-alert-title = Remove This Container?
|
||||
|
||||
# Variables:
|
||||
# $count (Number) - Number of tabs that will be closed.
|
||||
containers-remove-alert-msg =
|
||||
{ $count ->
|
||||
*[one] If you remove this Container now, { $count } container tab will be closed. Are you sure you want to remove this Container?
|
||||
[other] If you remove this Container now, { $count } container tabs will be closed. Are you sure you want to remove this Container?
|
||||
}
|
||||
|
||||
containers-remove-ok-button = Remove this Container
|
||||
containers-remove-cancel-button = Don’t remove this Container
|
||||
|
||||
containers-color-blue =
|
||||
.label = Blue
|
||||
containers-color-turquoise =
|
||||
.label = Turquoise
|
||||
containers-color-green =
|
||||
.label = Green
|
||||
containers-color-yellow =
|
||||
.label = Yellow
|
||||
containers-color-orange =
|
||||
.label = Orange
|
||||
containers-color-red =
|
||||
.label = Red
|
||||
containers-color-pink =
|
||||
.label = Pink
|
||||
containers-color-purple =
|
||||
.label = Purple
|
||||
|
||||
containers-icon-fingerprint =
|
||||
.label = Fingerprint
|
||||
containers-icon-briefcase =
|
||||
.label = Briefcase
|
||||
# String represents a money sign but currently uses a dollar sign
|
||||
# so don't change to local currency. See Bug 1291672.
|
||||
containers-icon-dollar =
|
||||
.label = Dollar sign
|
||||
containers-icon-cart =
|
||||
.label = Shopping cart
|
||||
containers-icon-circle =
|
||||
.label = Dot
|
||||
containers-icon-vacation =
|
||||
.label = Vacation
|
||||
containers-icon-gift =
|
||||
.label = Gift
|
||||
containers-icon-food =
|
||||
.label = Food
|
||||
containers-icon-fruit =
|
||||
.label = Fruit
|
||||
containers-icon-pet =
|
||||
.label = Pet
|
||||
containers-icon-tree =
|
||||
.label = Tree
|
||||
containers-icon-chill =
|
||||
.label = Chill
|
|
@ -462,3 +462,16 @@ search-keyword-warning-title = Duplicate Keyword
|
|||
# $name (String) - Name of a search engine.
|
||||
search-keyword-warning-engine = You have chosen a keyword that is currently in use by “{ $name }”. Please select another.
|
||||
search-keyword-warning-bookmark = You have chosen a keyword that is currently in use by a bookmark. Please select another.
|
||||
|
||||
## Containers Section
|
||||
|
||||
containers-back-link = « Go Back
|
||||
containers-header = Container Tabs
|
||||
containers-add-button =
|
||||
.label = Add New Container
|
||||
.accesskey = A
|
||||
|
||||
containers-preferences-button =
|
||||
.label = Preferences
|
||||
containers-remove-button =
|
||||
.label = Remove
|
||||
|
|
|
@ -1,25 +0,0 @@
|
|||
<!-- 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/. -->
|
||||
|
||||
<!ENTITY addButton.label "Add New Container">
|
||||
<!ENTITY addButton.accesskey "A">
|
||||
<!ENTITY preferencesButton.label "Preferences">
|
||||
<!ENTITY removeButton.label "Remove">
|
||||
<!-- « is « however it's not defined in XML -->
|
||||
<!ENTITY backLink2.label "« Go Back">
|
||||
|
||||
<!ENTITY window.title "Add New Container">
|
||||
<!ENTITY window.width "45em">
|
||||
|
||||
<!ENTITY name2.label "Name">
|
||||
<!ENTITY name2.accesskey "N">
|
||||
<!ENTITY name.placeholder "Enter a container name">
|
||||
<!ENTITY icon2.label "Icon">
|
||||
<!ENTITY icon2.accesskey "I">
|
||||
<!ENTITY color2.label "Color">
|
||||
<!ENTITY color2.accesskey "o">
|
||||
<!ENTITY windowClose.key "w">
|
||||
|
||||
<!ENTITY button.ok.label "Done">
|
||||
<!ENTITY button.ok.accesskey "D">
|
|
@ -1,31 +0,0 @@
|
|||
# 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/.
|
||||
|
||||
containers.labelMinWidth = 4rem
|
||||
containers.updateContainerTitle = %S Container Preferences
|
||||
|
||||
containers.blue.label = Blue
|
||||
containers.turquoise.label = Turquoise
|
||||
containers.green.label = Green
|
||||
containers.yellow.label = Yellow
|
||||
containers.orange.label = Orange
|
||||
containers.red.label = Red
|
||||
containers.pink.label = Pink
|
||||
containers.purple.label = Purple
|
||||
|
||||
containers.fingerprint.label = Fingerprint
|
||||
containers.briefcase.label = Briefcase
|
||||
# LOCALIZATION NOTE (containers.dollar.label)
|
||||
# String represents a money sign but currently uses a dollar sign so don't change to local currency
|
||||
# See Bug 1291672
|
||||
containers.dollar.label = Dollar sign
|
||||
containers.cart.label = Shopping cart
|
||||
containers.circle.label = Dot
|
||||
containers.vacation.label = Vacation
|
||||
containers.gift.label = Gift
|
||||
containers.food.label = Food
|
||||
containers.fruit.label = Fruit
|
||||
containers.pet.label = Pet
|
||||
containers.tree.label = Tree
|
||||
containers.chill.label = Chill
|
|
@ -2,8 +2,6 @@
|
|||
- 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/. -->
|
||||
|
||||
<!ENTITY paneContainers.title "Container Tabs">
|
||||
|
||||
<!ENTITY browserPrivacy.label "Browser Privacy">
|
||||
|
||||
<!-- LOCALIZATION NOTE (paneSync1.title): This should match syncBrand.fxAccount.label in ../syncBrand.dtd -->
|
||||
|
|
|
@ -207,16 +207,6 @@ spaceAlert.under5GB.okButton.accesskey=K
|
|||
# LOCALIZATION NOTE (spaceAlert.under5GB.message): %S = brandShortName
|
||||
spaceAlert.under5GB.message=%S is running out of disk space. Website contents may not display properly. Visit “Learn More” to optimize your disk usage for better browsing experience.
|
||||
|
||||
removeContainerAlertTitle=Remove This Container?
|
||||
|
||||
# LOCALIZATION NOTE (removeContainerMsg): Semi-colon list of plural forms.
|
||||
# See: http://developer.mozilla.org/en/docs/Localization_and_Plurals
|
||||
# #S is the number of container tabs
|
||||
removeContainerMsg=If you remove this Container now, #S container tab will be closed. Are you sure you want to remove this Container?;If you remove this Container now, #S container tabs will be closed. Are you sure you want to remove this Container?
|
||||
|
||||
removeContainerOkButton=Remove this Container
|
||||
removeContainerButton2=Don’t remove this Container
|
||||
|
||||
# LOCALIZATION NOTE (extensionControlled.homepage_override):
|
||||
# This string is shown to notify the user that their home page is being controlled by an extension.
|
||||
extensionControlled.homepage_override2 = An extension, %S, is controlling your home page.
|
||||
|
|
|
@ -65,8 +65,6 @@
|
|||
locale/browser/preferences/clearSiteData.properties (%chrome/browser/preferences/clearSiteData.properties)
|
||||
locale/browser/preferences/colors.dtd (%chrome/browser/preferences/colors.dtd)
|
||||
locale/browser/preferences/connection.dtd (%chrome/browser/preferences/connection.dtd)
|
||||
locale/browser/preferences/containers.dtd (%chrome/browser/preferences/containers.dtd)
|
||||
locale/browser/preferences/containers.properties (%chrome/browser/preferences/containers.properties)
|
||||
locale/browser/preferences/content.dtd (%chrome/browser/preferences/content.dtd)
|
||||
locale/browser/preferences/cookies.dtd (%chrome/browser/preferences/cookies.dtd)
|
||||
locale/browser/preferences/fonts.dtd (%chrome/browser/preferences/fonts.dtd)
|
||||
|
|
|
@ -0,0 +1,524 @@
|
|||
# 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 MESSAGE_REFERENCE, EXTERNAL_ARGUMENT
|
||||
from fluent.migrate import COPY, CONCAT, REPLACE
|
||||
from fluent.migrate.transforms import PLURALS, REPLACE_IN_TEXT
|
||||
|
||||
|
||||
def migrate(ctx):
|
||||
"""Bug 1419547 - Migrate Preferences::Containers to Fluent, part {index}."""
|
||||
|
||||
ctx.add_transforms(
|
||||
'browser/browser/preferences/preferences.ftl',
|
||||
'browser/locales/en-US/browser/preferences/preferences.ftl',
|
||||
[
|
||||
FTL.Message(
|
||||
id=FTL.Identifier('containers-back-link'),
|
||||
value=COPY(
|
||||
'browser/chrome/browser/preferences/containers.dtd',
|
||||
'backLink2.label'
|
||||
)
|
||||
),
|
||||
FTL.Message(
|
||||
id=FTL.Identifier('containers-header'),
|
||||
value=COPY(
|
||||
'browser/chrome/browser/preferences/containers.dtd',
|
||||
'paneContainers.title',
|
||||
)
|
||||
),
|
||||
FTL.Message(
|
||||
id=FTL.Identifier('containers-add-button'),
|
||||
attributes=[
|
||||
FTL.Attribute(
|
||||
FTL.Identifier('label'),
|
||||
COPY(
|
||||
'browser/chrome/browser/preferences/containers.dtd',
|
||||
'addButton.label'
|
||||
)
|
||||
),
|
||||
FTL.Attribute(
|
||||
FTL.Identifier('accesskey'),
|
||||
COPY(
|
||||
'browser/chrome/browser/preferences/containers.dtd',
|
||||
'addButton.accesskey'
|
||||
)
|
||||
),
|
||||
]
|
||||
),
|
||||
FTL.Message(
|
||||
id=FTL.Identifier('containers-preferences-button'),
|
||||
attributes=[
|
||||
FTL.Attribute(
|
||||
FTL.Identifier('label'),
|
||||
COPY(
|
||||
'browser/chrome/browser/preferences/containers.dtd',
|
||||
'preferencesButton.label'
|
||||
)
|
||||
),
|
||||
]
|
||||
),
|
||||
FTL.Message(
|
||||
id=FTL.Identifier('containers-remove-button'),
|
||||
attributes=[
|
||||
FTL.Attribute(
|
||||
FTL.Identifier('label'),
|
||||
COPY(
|
||||
'browser/chrome/browser/preferences/containers.dtd',
|
||||
'removeButton.label'
|
||||
)
|
||||
),
|
||||
]
|
||||
),
|
||||
]
|
||||
)
|
||||
|
||||
ctx.add_transforms(
|
||||
'browser/browser/preferences/containers.ftl',
|
||||
'browser/locales/en-US/browser/preferences/containers.ftl',
|
||||
[
|
||||
FTL.Message(
|
||||
id=FTL.Identifier('containers-window-new'),
|
||||
attributes=[
|
||||
FTL.Attribute(
|
||||
FTL.Identifier('title'),
|
||||
COPY(
|
||||
'browser/chrome/browser/preferences/containers.dtd',
|
||||
'window.title',
|
||||
),
|
||||
),
|
||||
FTL.Attribute(
|
||||
FTL.Identifier('style'),
|
||||
CONCAT(
|
||||
FTL.TextElement('width: '),
|
||||
COPY(
|
||||
'browser/chrome/browser/preferences/containers.dtd',
|
||||
'window.width',
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
FTL.Message(
|
||||
id=FTL.Identifier('containers-window-update'),
|
||||
attributes=[
|
||||
FTL.Attribute(
|
||||
FTL.Identifier('title'),
|
||||
REPLACE(
|
||||
'browser/chrome/browser/preferences/containers.properties',
|
||||
'containers.updateContainerTitle',
|
||||
{
|
||||
'%S': EXTERNAL_ARGUMENT('name')
|
||||
},
|
||||
),
|
||||
),
|
||||
FTL.Attribute(
|
||||
FTL.Identifier('style'),
|
||||
COPY(
|
||||
'browser/chrome/browser/preferences/containers.dtd',
|
||||
'window.width',
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
FTL.Message(
|
||||
id=FTL.Identifier('containers-window-close'),
|
||||
attributes=[
|
||||
FTL.Attribute(
|
||||
FTL.Identifier('key'),
|
||||
COPY(
|
||||
'browser/chrome/browser/preferences/containers.dtd',
|
||||
'windowClose.key',
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
FTL.Term(
|
||||
id=FTL.Identifier('-containers-labels-style'),
|
||||
value=CONCAT(
|
||||
FTL.TextElement('min-width: '),
|
||||
COPY(
|
||||
'browser/chrome/browser/preferences/containers.properties',
|
||||
'containers.labelMinWidth',
|
||||
),
|
||||
),
|
||||
),
|
||||
FTL.Message(
|
||||
id=FTL.Identifier('containers-name-label'),
|
||||
value=COPY(
|
||||
'browser/chrome/browser/preferences/containers.dtd',
|
||||
'name2.label',
|
||||
),
|
||||
attributes=[
|
||||
FTL.Attribute(
|
||||
FTL.Identifier('accesskey'),
|
||||
COPY(
|
||||
'browser/chrome/browser/preferences/containers.dtd',
|
||||
'name2.accesskey',
|
||||
),
|
||||
),
|
||||
FTL.Attribute(
|
||||
FTL.Identifier('style'),
|
||||
CONCAT(
|
||||
MESSAGE_REFERENCE('-containers-labels-style'),
|
||||
)
|
||||
),
|
||||
],
|
||||
),
|
||||
FTL.Message(
|
||||
id=FTL.Identifier('containers-name-text'),
|
||||
attributes=[
|
||||
FTL.Attribute(
|
||||
FTL.Identifier('placeholder'),
|
||||
COPY(
|
||||
'browser/chrome/browser/preferences/containers.dtd',
|
||||
'name.placeholder',
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
FTL.Message(
|
||||
id=FTL.Identifier('containers-icon-label'),
|
||||
value=COPY(
|
||||
'browser/chrome/browser/preferences/containers.dtd',
|
||||
'icon2.label',
|
||||
),
|
||||
attributes=[
|
||||
FTL.Attribute(
|
||||
FTL.Identifier('accesskey'),
|
||||
COPY(
|
||||
'browser/chrome/browser/preferences/containers.dtd',
|
||||
'icon2.accesskey',
|
||||
),
|
||||
),
|
||||
FTL.Attribute(
|
||||
FTL.Identifier('style'),
|
||||
CONCAT(
|
||||
MESSAGE_REFERENCE('-containers-labels-style'),
|
||||
)
|
||||
),
|
||||
],
|
||||
),
|
||||
FTL.Message(
|
||||
id=FTL.Identifier('containers-color-label'),
|
||||
value=COPY(
|
||||
'browser/chrome/browser/preferences/containers.dtd',
|
||||
'color2.label',
|
||||
),
|
||||
attributes=[
|
||||
FTL.Attribute(
|
||||
FTL.Identifier('accesskey'),
|
||||
COPY(
|
||||
'browser/chrome/browser/preferences/containers.dtd',
|
||||
'color2.accesskey',
|
||||
),
|
||||
),
|
||||
FTL.Attribute(
|
||||
FTL.Identifier('style'),
|
||||
CONCAT(
|
||||
MESSAGE_REFERENCE('-containers-labels-style'),
|
||||
)
|
||||
),
|
||||
],
|
||||
),
|
||||
FTL.Message(
|
||||
id=FTL.Identifier('containers-button-done'),
|
||||
attributes=[
|
||||
FTL.Attribute(
|
||||
FTL.Identifier('label'),
|
||||
COPY(
|
||||
'browser/chrome/browser/preferences/containers.dtd',
|
||||
'button.ok.label',
|
||||
),
|
||||
),
|
||||
FTL.Attribute(
|
||||
FTL.Identifier('accesskey'),
|
||||
COPY(
|
||||
'browser/chrome/browser/preferences/containers.dtd',
|
||||
'button.ok.accesskey',
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
FTL.Message(
|
||||
id=FTL.Identifier('containers-remove-alert-title'),
|
||||
value=COPY(
|
||||
'browser/chrome/browser/preferences/preferences.properties',
|
||||
'removeContainerAlertTitle',
|
||||
),
|
||||
),
|
||||
FTL.Message(
|
||||
id=FTL.Identifier('containers-remove-alert-msg'),
|
||||
value=PLURALS(
|
||||
'browser/chrome/browser/preferences/preferences.properties',
|
||||
'removeContainerMsg',
|
||||
EXTERNAL_ARGUMENT('count'),
|
||||
lambda text: REPLACE_IN_TEXT(
|
||||
text,
|
||||
{
|
||||
'#S': EXTERNAL_ARGUMENT('count')
|
||||
}
|
||||
)
|
||||
)
|
||||
),
|
||||
FTL.Message(
|
||||
id=FTL.Identifier('containers-remove-ok-button'),
|
||||
value=COPY(
|
||||
'browser/chrome/browser/preferences/preferences.properties',
|
||||
'removeContainerOkButton',
|
||||
),
|
||||
),
|
||||
FTL.Message(
|
||||
id=FTL.Identifier('containers-remove-cancel-button'),
|
||||
value=COPY(
|
||||
'browser/chrome/browser/preferences/preferences.properties',
|
||||
'removeContainerButton2',
|
||||
),
|
||||
),
|
||||
FTL.Message(
|
||||
id=FTL.Identifier('containers-color-blue'),
|
||||
attributes=[
|
||||
FTL.Attribute(
|
||||
FTL.Identifier('label'),
|
||||
COPY(
|
||||
'browser/chrome/browser/preferences/containers.properties',
|
||||
'containers.blue.label',
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
FTL.Message(
|
||||
id=FTL.Identifier('containers-color-turquoise'),
|
||||
attributes=[
|
||||
FTL.Attribute(
|
||||
FTL.Identifier('label'),
|
||||
COPY(
|
||||
'browser/chrome/browser/preferences/containers.properties',
|
||||
'containers.turquoise.label',
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
FTL.Message(
|
||||
id=FTL.Identifier('containers-color-green'),
|
||||
attributes=[
|
||||
FTL.Attribute(
|
||||
FTL.Identifier('label'),
|
||||
COPY(
|
||||
'browser/chrome/browser/preferences/containers.properties',
|
||||
'containers.green.label',
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
FTL.Message(
|
||||
id=FTL.Identifier('containers-color-yellow'),
|
||||
attributes=[
|
||||
FTL.Attribute(
|
||||
FTL.Identifier('label'),
|
||||
COPY(
|
||||
'browser/chrome/browser/preferences/containers.properties',
|
||||
'containers.yellow.label',
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
FTL.Message(
|
||||
id=FTL.Identifier('containers-color-orange'),
|
||||
attributes=[
|
||||
FTL.Attribute(
|
||||
FTL.Identifier('label'),
|
||||
COPY(
|
||||
'browser/chrome/browser/preferences/containers.properties',
|
||||
'containers.orange.label',
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
FTL.Message(
|
||||
id=FTL.Identifier('containers-color-red'),
|
||||
attributes=[
|
||||
FTL.Attribute(
|
||||
FTL.Identifier('label'),
|
||||
COPY(
|
||||
'browser/chrome/browser/preferences/containers.properties',
|
||||
'containers.red.label',
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
FTL.Message(
|
||||
id=FTL.Identifier('containers-color-pink'),
|
||||
attributes=[
|
||||
FTL.Attribute(
|
||||
FTL.Identifier('label'),
|
||||
COPY(
|
||||
'browser/chrome/browser/preferences/containers.properties',
|
||||
'containers.pink.label',
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
FTL.Message(
|
||||
id=FTL.Identifier('containers-color-purple'),
|
||||
attributes=[
|
||||
FTL.Attribute(
|
||||
FTL.Identifier('label'),
|
||||
COPY(
|
||||
'browser/chrome/browser/preferences/containers.properties',
|
||||
'containers.purple.label',
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
FTL.Message(
|
||||
id=FTL.Identifier('containers-icon-fingerprint'),
|
||||
attributes=[
|
||||
FTL.Attribute(
|
||||
FTL.Identifier('label'),
|
||||
COPY(
|
||||
'browser/chrome/browser/preferences/containers.properties',
|
||||
'containers.fingerprint.label',
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
FTL.Message(
|
||||
id=FTL.Identifier('containers-icon-briefcase'),
|
||||
attributes=[
|
||||
FTL.Attribute(
|
||||
FTL.Identifier('label'),
|
||||
COPY(
|
||||
'browser/chrome/browser/preferences/containers.properties',
|
||||
'containers.briefcase.label',
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
FTL.Message(
|
||||
id=FTL.Identifier('containers-icon-dollar'),
|
||||
attributes=[
|
||||
FTL.Attribute(
|
||||
FTL.Identifier('label'),
|
||||
COPY(
|
||||
'browser/chrome/browser/preferences/containers.properties',
|
||||
'containers.dollar.label',
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
FTL.Message(
|
||||
id=FTL.Identifier('containers-icon-cart'),
|
||||
attributes=[
|
||||
FTL.Attribute(
|
||||
FTL.Identifier('label'),
|
||||
COPY(
|
||||
'browser/chrome/browser/preferences/containers.properties',
|
||||
'containers.cart.label',
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
FTL.Message(
|
||||
id=FTL.Identifier('containers-icon-circle'),
|
||||
attributes=[
|
||||
FTL.Attribute(
|
||||
FTL.Identifier('label'),
|
||||
COPY(
|
||||
'browser/chrome/browser/preferences/containers.properties',
|
||||
'containers.circle.label',
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
FTL.Message(
|
||||
id=FTL.Identifier('containers-icon-vacation'),
|
||||
attributes=[
|
||||
FTL.Attribute(
|
||||
FTL.Identifier('label'),
|
||||
COPY(
|
||||
'browser/chrome/browser/preferences/containers.properties',
|
||||
'containers.vacation.label',
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
FTL.Message(
|
||||
id=FTL.Identifier('containers-icon-gift'),
|
||||
attributes=[
|
||||
FTL.Attribute(
|
||||
FTL.Identifier('label'),
|
||||
COPY(
|
||||
'browser/chrome/browser/preferences/containers.properties',
|
||||
'containers.gift.label',
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
FTL.Message(
|
||||
id=FTL.Identifier('containers-icon-food'),
|
||||
attributes=[
|
||||
FTL.Attribute(
|
||||
FTL.Identifier('label'),
|
||||
COPY(
|
||||
'browser/chrome/browser/preferences/containers.properties',
|
||||
'containers.food.label',
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
FTL.Message(
|
||||
id=FTL.Identifier('containers-icon-fruit'),
|
||||
attributes=[
|
||||
FTL.Attribute(
|
||||
FTL.Identifier('label'),
|
||||
COPY(
|
||||
'browser/chrome/browser/preferences/containers.properties',
|
||||
'containers.fruit.label',
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
FTL.Message(
|
||||
id=FTL.Identifier('containers-icon-pet'),
|
||||
attributes=[
|
||||
FTL.Attribute(
|
||||
FTL.Identifier('label'),
|
||||
COPY(
|
||||
'browser/chrome/browser/preferences/containers.properties',
|
||||
'containers.pet.label',
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
FTL.Message(
|
||||
id=FTL.Identifier('containers-icon-tree'),
|
||||
attributes=[
|
||||
FTL.Attribute(
|
||||
FTL.Identifier('label'),
|
||||
COPY(
|
||||
'browser/chrome/browser/preferences/containers.properties',
|
||||
'containers.tree.label',
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
FTL.Message(
|
||||
id=FTL.Identifier('containers-icon-chill'),
|
||||
attributes=[
|
||||
FTL.Attribute(
|
||||
FTL.Identifier('label'),
|
||||
COPY(
|
||||
'browser/chrome/browser/preferences/containers.properties',
|
||||
'containers.chill.label',
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
]
|
||||
)
|
Загрузка…
Ссылка в новой задаче