forked from mozilla/gecko-dev
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bug 1608197 - port createProfileWizard DTD to fluent r=Gijs,fluent-re…
…viewers,flod Differential Revision: https://phabricator.services.mozilla.com/D62867 --HG-- extra : moz-landing-system : lando
- Loading branch information
Artem
committed
Mar 24, 2020
1 parent
1a8fa11
commit 0a5bdf8
Showing
7 changed files
with
244 additions
and
58 deletions.
There are no files selected for viewing
149 changes: 149 additions & 0 deletions
149
python/l10n/fluent_migrations/bug_1608197_create_profile_wizard.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
) | ||
) | ||
] | ||
) | ||
) | ||
] | ||
) | ||
), | ||
] | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 0 additions & 25 deletions
25
toolkit/locales/en-US/chrome/mozapps/profile/createProfileWizard.dtd
This file was deleted.
Oops, something went wrong.
53 changes: 53 additions & 0 deletions
53
toolkit/locales/en-US/toolkit/global/createProfileWizard.ftl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters