Bug 1608197 - port createProfileWizard DTD to fluent r=Gijs,fluent-reviewers,flod
Differential Revision: https://phabricator.services.mozilla.com/D62867
This commit is contained in:
@@ -0,0 +1,149 @@
|
|||||||
|
# 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 import COPY, REPLACE
|
||||||
|
from fluent.migrate.helpers import MESSAGE_REFERENCE, TERM_REFERENCE
|
||||||
|
|
||||||
|
def migrate(ctx):
|
||||||
|
"""Bug 1608197 - Migrate createProfileWizard to Fluent, part {index}."""
|
||||||
|
|
||||||
|
ctx.add_transforms(
|
||||||
|
"toolkit/toolkit/global/createProfileWizard.ftl",
|
||||||
|
"toolkit/toolkit/global/createProfileWizard.ftl",
|
||||||
|
transforms_from(
|
||||||
|
"""
|
||||||
|
create-profile-window =
|
||||||
|
.title = { COPY(from_path, "newprofile.title") }
|
||||||
|
.style = { COPY(from_path, "window.size") }
|
||||||
|
profile-creation-explanation-4 = { PLATFORM() ->
|
||||||
|
[macos] { COPY(from_path, "profileCreationExplanation_4Mac.text") }
|
||||||
|
*[other] { COPY(from_path, "profileCreationExplanation_4.text") }
|
||||||
|
}
|
||||||
|
profile-creation-intro = { COPY(from_path, "profileCreationIntro.text") }
|
||||||
|
profile-prompt = { COPY(from_path, "profilePrompt.label") }
|
||||||
|
.accesskey = { COPY(from_path, "profilePrompt.accesskey") }
|
||||||
|
profile-default-name =
|
||||||
|
.value = { COPY(from_path, "profileDefaultName") }
|
||||||
|
profile-directory-explanation = { COPY(from_path, "profileDirectoryExplanation.text") }
|
||||||
|
create-profile-choose-folder =
|
||||||
|
.label = { COPY(from_path, "button.choosefolder.label") }
|
||||||
|
.accesskey = { COPY(from_path, "button.choosefolder.accesskey") }
|
||||||
|
create-profile-use-default =
|
||||||
|
.label = { COPY(from_path, "button.usedefault.label") }
|
||||||
|
.accesskey = { COPY(from_path, "button.usedefault.accesskey") }
|
||||||
|
""", from_path="toolkit/chrome/mozapps/profile/createProfileWizard.dtd"))
|
||||||
|
ctx.add_transforms(
|
||||||
|
"toolkit/toolkit/global/createProfileWizard.ftl",
|
||||||
|
"toolkit/toolkit/global/createProfileWizard.ftl",
|
||||||
|
[
|
||||||
|
FTL.Message(
|
||||||
|
id=FTL.Identifier("create-profile-first-page-header"),
|
||||||
|
value=FTL.Pattern(
|
||||||
|
elements=[
|
||||||
|
FTL.Placeable(
|
||||||
|
expression=FTL.SelectExpression(
|
||||||
|
selector=FTL.FunctionReference(
|
||||||
|
id=FTL.Identifier(name="PLATFORM"),
|
||||||
|
arguments=FTL.CallArguments(positional=[], named=[])
|
||||||
|
),
|
||||||
|
variants=[
|
||||||
|
FTL.Variant(
|
||||||
|
key=FTL.Identifier('macos'),
|
||||||
|
default=False,
|
||||||
|
value=COPY(
|
||||||
|
"toolkit/chrome/global/wizard.properties",
|
||||||
|
"default-first-title-mac",
|
||||||
|
)
|
||||||
|
),
|
||||||
|
FTL.Variant(
|
||||||
|
key=FTL.Identifier('other'),
|
||||||
|
default=True,
|
||||||
|
value=REPLACE(
|
||||||
|
"toolkit/chrome/global/wizard.properties",
|
||||||
|
"default-first-title",
|
||||||
|
{
|
||||||
|
"%1$S": MESSAGE_REFERENCE("create-profile-window.title"),
|
||||||
|
},
|
||||||
|
normalize_printf=True
|
||||||
|
)
|
||||||
|
)
|
||||||
|
]
|
||||||
|
)
|
||||||
|
)
|
||||||
|
]
|
||||||
|
)
|
||||||
|
),
|
||||||
|
FTL.Message(
|
||||||
|
id=FTL.Identifier("profile-creation-explanation-1"),
|
||||||
|
value=REPLACE(
|
||||||
|
"toolkit/chrome/mozapps/profile/createProfileWizard.dtd",
|
||||||
|
"profileCreationExplanation_1.text",
|
||||||
|
{
|
||||||
|
"&brandShortName;": TERM_REFERENCE("brand-short-name")
|
||||||
|
}
|
||||||
|
)
|
||||||
|
),
|
||||||
|
FTL.Message(
|
||||||
|
id=FTL.Identifier("profile-creation-explanation-2"),
|
||||||
|
value=REPLACE(
|
||||||
|
"toolkit/chrome/mozapps/profile/createProfileWizard.dtd",
|
||||||
|
"profileCreationExplanation_2.text",
|
||||||
|
{
|
||||||
|
"&brandShortName;": TERM_REFERENCE("brand-short-name")
|
||||||
|
}
|
||||||
|
)
|
||||||
|
),
|
||||||
|
FTL.Message(
|
||||||
|
id=FTL.Identifier("profile-creation-explanation-3"),
|
||||||
|
value=REPLACE(
|
||||||
|
"toolkit/chrome/mozapps/profile/createProfileWizard.dtd",
|
||||||
|
"profileCreationExplanation_3.text",
|
||||||
|
{
|
||||||
|
"&brandShortName;": TERM_REFERENCE("brand-short-name")
|
||||||
|
}
|
||||||
|
)
|
||||||
|
),
|
||||||
|
FTL.Message(
|
||||||
|
id=FTL.Identifier("create-profile-last-page-header"),
|
||||||
|
value=FTL.Pattern(
|
||||||
|
elements=[
|
||||||
|
FTL.Placeable(
|
||||||
|
expression=FTL.SelectExpression(
|
||||||
|
selector=FTL.FunctionReference(
|
||||||
|
id=FTL.Identifier(name="PLATFORM"),
|
||||||
|
arguments=FTL.CallArguments(positional=[], named=[])
|
||||||
|
),
|
||||||
|
variants=[
|
||||||
|
FTL.Variant(
|
||||||
|
key=FTL.Identifier('macos'),
|
||||||
|
default=False,
|
||||||
|
value=COPY(
|
||||||
|
"toolkit/chrome/global/wizard.properties",
|
||||||
|
"default-last-title-mac",
|
||||||
|
)
|
||||||
|
),
|
||||||
|
FTL.Variant(
|
||||||
|
key=FTL.Identifier('other'),
|
||||||
|
default=True,
|
||||||
|
value=REPLACE(
|
||||||
|
"toolkit/chrome/global/wizard.properties",
|
||||||
|
"default-last-title",
|
||||||
|
{
|
||||||
|
"%1$S": MESSAGE_REFERENCE("create-profile-window.title"),
|
||||||
|
},
|
||||||
|
normalize_printf=True
|
||||||
|
)
|
||||||
|
)
|
||||||
|
]
|
||||||
|
)
|
||||||
|
)
|
||||||
|
]
|
||||||
|
)
|
||||||
|
),
|
||||||
|
]
|
||||||
|
)
|
||||||
@@ -108,6 +108,9 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
connectedCallback() {
|
connectedCallback() {
|
||||||
|
if (document.l10n) {
|
||||||
|
document.l10n.connectRoot(this.shadowRoot);
|
||||||
|
}
|
||||||
document.documentElement.setAttribute("role", "dialog");
|
document.documentElement.setAttribute("role", "dialog");
|
||||||
this._maybeStartWizard();
|
this._maybeStartWizard();
|
||||||
|
|
||||||
@@ -419,6 +422,10 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
_adjustWizardHeader() {
|
_adjustWizardHeader() {
|
||||||
|
if (document.l10n) {
|
||||||
|
this._adjustFluentHeaders();
|
||||||
|
return;
|
||||||
|
}
|
||||||
var label = this.currentPage.getAttribute("label");
|
var label = this.currentPage.getAttribute("label");
|
||||||
if (!label && this.onFirstPage && this._bundle) {
|
if (!label && this.onFirstPage && this._bundle) {
|
||||||
if (AppConstants.platform == "macosx") {
|
if (AppConstants.platform == "macosx") {
|
||||||
@@ -448,6 +455,17 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_adjustFluentHeaders() {
|
||||||
|
let value = this.currentPage.getAttribute("data-header-label-id");
|
||||||
|
let label = this._wizardHeader.querySelector(".wizard-header-label");
|
||||||
|
if (value) {
|
||||||
|
document.l10n.setAttributes(label, value);
|
||||||
|
} else {
|
||||||
|
label.removeAttribute("data-l10n-id");
|
||||||
|
label.textContent = "";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
_hitEnter(evt) {
|
_hitEnter(evt) {
|
||||||
if (!evt.defaultPrevented) {
|
if (!evt.defaultPrevented) {
|
||||||
this.advance();
|
this.advance();
|
||||||
|
|||||||
@@ -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 newprofile.title "Create Profile Wizard">
|
|
||||||
<!ENTITY window.size "width: 45em; height: 32em;">
|
|
||||||
|
|
||||||
<!-- First wizard page -->
|
|
||||||
<!ENTITY profileCreationExplanation_1.text "&brandShortName; stores information about your settings and preferences in your personal profile.">
|
|
||||||
<!ENTITY profileCreationExplanation_2.text "If you are sharing this copy of &brandShortName; with other users, you can use profiles to keep each user’s information separate. To do this, each user should create his or her own profile.">
|
|
||||||
<!ENTITY profileCreationExplanation_3.text "If you are the only person using this copy of &brandShortName;, you must have at least one profile. If you would like, you can create multiple profiles for yourself to store different sets of settings and preferences. For example, you may want to have separate profiles for business and personal use.">
|
|
||||||
<!ENTITY profileCreationExplanation_4.text "To begin creating your profile, click Next.">
|
|
||||||
<!ENTITY profileCreationExplanation_4Mac.text "To begin creating your profile, click Continue.">
|
|
||||||
<!ENTITY profileCreationExplanation_4Gnome.text "To begin creating your profile, click Next.">
|
|
||||||
|
|
||||||
<!-- Second wizard page -->
|
|
||||||
<!ENTITY profileCreationIntro.text "If you create several profiles you can tell them apart by the profile names. You may use the name provided here or use one of your own.">
|
|
||||||
<!ENTITY profilePrompt.label "Enter new profile name:">
|
|
||||||
<!ENTITY profilePrompt.accesskey "E">
|
|
||||||
<!ENTITY profileDirectoryExplanation.text "Your user settings, preferences and other user-related data will be stored in:">
|
|
||||||
<!ENTITY profileDefaultName "Default User">
|
|
||||||
<!ENTITY button.choosefolder.label "Choose Folder…">
|
|
||||||
<!ENTITY button.choosefolder.accesskey "C">
|
|
||||||
<!ENTITY button.usedefault.label "Use Default Folder">
|
|
||||||
<!ENTITY button.usedefault.accesskey "U">
|
|
||||||
53
toolkit/locales/en-US/toolkit/global/createProfileWizard.ftl
Normal file
53
toolkit/locales/en-US/toolkit/global/createProfileWizard.ftl
Normal file
@@ -0,0 +1,53 @@
|
|||||||
|
# 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/.
|
||||||
|
|
||||||
|
create-profile-window =
|
||||||
|
.title = Create Profile Wizard
|
||||||
|
.style = width: 45em; height: 32em;
|
||||||
|
|
||||||
|
## First wizard page
|
||||||
|
|
||||||
|
create-profile-first-page-header =
|
||||||
|
{ PLATFORM() ->
|
||||||
|
[macos] Introduction
|
||||||
|
*[other] Welcome to the { create-profile-window.title }
|
||||||
|
}
|
||||||
|
|
||||||
|
profile-creation-explanation-1 = { -brand-short-name } stores information about your settings and preferences in your personal profile.
|
||||||
|
|
||||||
|
profile-creation-explanation-2 = If you are sharing this copy of { -brand-short-name } with other users, you can use profiles to keep each user’s information separate. To do this, each user should create his or her own profile.
|
||||||
|
|
||||||
|
profile-creation-explanation-3 = If you are the only person using this copy of { -brand-short-name }, you must have at least one profile. If you would like, you can create multiple profiles for yourself to store different sets of settings and preferences. For example, you may want to have separate profiles for business and personal use.
|
||||||
|
|
||||||
|
profile-creation-explanation-4 =
|
||||||
|
{ PLATFORM() ->
|
||||||
|
[macos] To begin creating your profile, click Continue.
|
||||||
|
*[other] To begin creating your profile, click Next.
|
||||||
|
}
|
||||||
|
|
||||||
|
## Second wizard page
|
||||||
|
|
||||||
|
create-profile-last-page-header =
|
||||||
|
{ PLATFORM() ->
|
||||||
|
[macos] Conclusion
|
||||||
|
*[other] Completing the { create-profile-window.title }
|
||||||
|
}
|
||||||
|
|
||||||
|
profile-creation-intro = If you create several profiles you can tell them apart by the profile names. You may use the name provided here or use one of your own.
|
||||||
|
|
||||||
|
profile-prompt = Enter new profile name:
|
||||||
|
.accesskey = E
|
||||||
|
|
||||||
|
profile-default-name =
|
||||||
|
.value = Default User
|
||||||
|
|
||||||
|
profile-directory-explanation = Your user settings, preferences and other user-related data will be stored in:
|
||||||
|
|
||||||
|
create-profile-choose-folder =
|
||||||
|
.label = Choose Folder…
|
||||||
|
.accesskey = C
|
||||||
|
|
||||||
|
create-profile-use-default =
|
||||||
|
.label = Use Default Folder
|
||||||
|
.accesskey = U
|
||||||
@@ -74,7 +74,6 @@
|
|||||||
#endif
|
#endif
|
||||||
locale/@AB_CD@/mozapps/handling/handling.dtd (%chrome/mozapps/handling/handling.dtd)
|
locale/@AB_CD@/mozapps/handling/handling.dtd (%chrome/mozapps/handling/handling.dtd)
|
||||||
locale/@AB_CD@/mozapps/handling/handling.properties (%chrome/mozapps/handling/handling.properties)
|
locale/@AB_CD@/mozapps/handling/handling.properties (%chrome/mozapps/handling/handling.properties)
|
||||||
locale/@AB_CD@/mozapps/profile/createProfileWizard.dtd (%chrome/mozapps/profile/createProfileWizard.dtd)
|
|
||||||
locale/@AB_CD@/mozapps/profile/profileSelection.properties (%chrome/mozapps/profile/profileSelection.properties)
|
locale/@AB_CD@/mozapps/profile/profileSelection.properties (%chrome/mozapps/profile/profileSelection.properties)
|
||||||
#ifdef MOZ_BLOCK_PROFILE_DOWNGRADE
|
#ifdef MOZ_BLOCK_PROFILE_DOWNGRADE
|
||||||
locale/@AB_CD@/mozapps/profile/profileDowngrade.dtd (%chrome/mozapps/profile/profileDowngrade.dtd)
|
locale/@AB_CD@/mozapps/profile/profileDowngrade.dtd (%chrome/mozapps/profile/profileDowngrade.dtd)
|
||||||
|
|||||||
@@ -5,20 +5,21 @@
|
|||||||
|
|
||||||
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
|
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
|
||||||
|
|
||||||
<!DOCTYPE wizard [
|
<!DOCTYPE wizard>
|
||||||
<!ENTITY % brandDTD SYSTEM "chrome://branding/locale/brand.dtd">
|
|
||||||
%brandDTD;
|
|
||||||
<!ENTITY % profileDTD SYSTEM "chrome://mozapps/locale/profile/createProfileWizard.dtd">
|
|
||||||
%profileDTD;
|
|
||||||
]>
|
|
||||||
|
|
||||||
<window id="createProfileWizard"
|
<window id="createProfileWizard"
|
||||||
title="&newprofile.title;"
|
data-l10n-id="create-profile-window"
|
||||||
xmlns:html="http://www.w3.org/1999/xhtml"
|
xmlns:html="http://www.w3.org/1999/xhtml"
|
||||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
|
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
|
||||||
onload="initWizard();"
|
onload="initWizard();"
|
||||||
style="&window.size;">
|
data-l10n-attrs="style"
|
||||||
|
>
|
||||||
|
|
||||||
|
<linkset>
|
||||||
|
<html:link rel="localization" href="branding/brand.ftl"/>
|
||||||
|
<html:link rel="localization" href="toolkit/global/createProfileWizard.ftl"/>
|
||||||
|
</linkset>
|
||||||
|
|
||||||
<script src="chrome://global/content/customElements.js"/>
|
<script src="chrome://global/content/customElements.js"/>
|
||||||
<script src="chrome://global/content/globalOverlay.js"/>
|
<script src="chrome://global/content/globalOverlay.js"/>
|
||||||
@@ -29,44 +30,35 @@
|
|||||||
<stringbundle id="bundle_profileManager"
|
<stringbundle id="bundle_profileManager"
|
||||||
src="chrome://mozapps/locale/profile/profileSelection.properties"/>
|
src="chrome://mozapps/locale/profile/profileSelection.properties"/>
|
||||||
|
|
||||||
<wizardpage id="explanation">
|
<wizardpage id="explanation" data-header-label-id="create-profile-first-page-header">
|
||||||
<description>&profileCreationExplanation_1.text;</description>
|
<description data-l10n-id="profile-creation-explanation-1"></description>
|
||||||
<description>&profileCreationExplanation_2.text;</description>
|
<description data-l10n-id="profile-creation-explanation-2"></description>
|
||||||
<description>&profileCreationExplanation_3.text;</description>
|
<description data-l10n-id="profile-creation-explanation-3"></description>
|
||||||
<spacer flex="1"/>
|
<spacer flex="1"/>
|
||||||
#ifdef XP_MACOSX
|
<description data-l10n-id="profile-creation-explanation-4"></description>
|
||||||
<description>&profileCreationExplanation_4Mac.text;</description>
|
|
||||||
#else
|
|
||||||
#ifdef XP_UNIX
|
|
||||||
<description>&profileCreationExplanation_4Gnome.text;</description>
|
|
||||||
#else
|
|
||||||
<description>&profileCreationExplanation_4.text;</description>
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
</wizardpage>
|
</wizardpage>
|
||||||
|
|
||||||
<wizardpage id="createProfile">
|
<wizardpage id="createProfile" data-header-label-id="create-profile-last-page-header">
|
||||||
<description>&profileCreationIntro.text;</description>
|
<description data-l10n-id="profile-creation-intro"></description>
|
||||||
|
|
||||||
<label accesskey="&profilePrompt.accesskey;" control="ProfileName">&profilePrompt.label;</label>
|
<label data-l10n-id="profile-prompt" control="ProfileName"></label>
|
||||||
<html:input id="profileName" value="&profileDefaultName;"
|
<html:input id="profileName" data-l10n-id="profile-default-name"
|
||||||
oninput="updateProfileName(this.value);"/>
|
data-l10n-attrs="value" oninput="updateProfileName(this.value);"/>
|
||||||
|
|
||||||
<separator/>
|
<separator/>
|
||||||
|
|
||||||
<description>&profileDirectoryExplanation.text;</description>
|
<description data-l10n-id="profile-directory-explanation"></description>
|
||||||
|
|
||||||
<vbox class="indent" flex="1" style="overflow: auto;">
|
<vbox class="indent" flex="1" style="overflow: auto;">
|
||||||
<description id="profileDisplay">*</description>
|
<description id="profileDisplay">*</description>
|
||||||
</vbox>
|
</vbox>
|
||||||
|
|
||||||
<hbox>
|
<hbox>
|
||||||
<button label="&button.choosefolder.label;" oncommand="chooseProfileFolder();"
|
<button data-l10n-id="create-profile-choose-folder" oncommand="chooseProfileFolder();"/>
|
||||||
accesskey="&button.choosefolder.accesskey;"/>
|
|
||||||
|
|
||||||
<button id="useDefault" label="&button.usedefault.label;"
|
<button id="useDefault" data-l10n-id="create-profile-use-default"
|
||||||
oncommand="setDisplayToDefaultFolder(); updateProfileDisplay();"
|
oncommand="setDisplayToDefaultFolder(); updateProfileDisplay();"
|
||||||
accesskey="&button.usedefault.accesskey;" disabled="true"/>
|
disabled="true"/>
|
||||||
</hbox>
|
</hbox>
|
||||||
|
|
||||||
<separator/>
|
<separator/>
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
toolkit.jar:
|
toolkit.jar:
|
||||||
content/mozapps/profile/createProfileWizard.js (content/createProfileWizard.js)
|
content/mozapps/profile/createProfileWizard.js (content/createProfileWizard.js)
|
||||||
* content/mozapps/profile/createProfileWizard.xhtml (content/createProfileWizard.xhtml)
|
content/mozapps/profile/createProfileWizard.xhtml (content/createProfileWizard.xhtml)
|
||||||
content/mozapps/profile/profileSelection.js (content/profileSelection.js)
|
content/mozapps/profile/profileSelection.js (content/profileSelection.js)
|
||||||
content/mozapps/profile/profileSelection.xhtml (content/profileSelection.xhtml)
|
content/mozapps/profile/profileSelection.xhtml (content/profileSelection.xhtml)
|
||||||
#ifdef MOZ_BLOCK_PROFILE_DOWNGRADE
|
#ifdef MOZ_BLOCK_PROFILE_DOWNGRADE
|
||||||
|
|||||||
Reference in New Issue
Block a user