Skip to content

Commit fa730ce

Browse files
authored
Merge pull request #20008 from mozilla/fix-l10n-merge
task(auth): Separate extraction of emails.ftl and auth.ftl strings
2 parents f13e29e + 27f015c commit fa730ce

4 files changed

Lines changed: 5559 additions & 3095 deletions

File tree

libs/accounts/email-renderer/README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,3 +59,16 @@ This code was ported from auth-server. The code's history should more or less be
5959
a files full history use the git `--follow` option. e.g.
6060

6161
`git log --follow -M -- libs/accounts/email-renderer/src/templates/cadReminderFirst/index.mjml`
62+
63+
## Migration Process for L10N strings.
64+
65+
Once we start using this library to render a given email template, we want to start tracking translations in this library as opposed to translation strings that were originally held in the auth-server's template.
66+
67+
To do this, do the following steps:
68+
69+
1. Uncomment (or add) a reference to the .ftl files that are currently being used in this library. These references are held in gruntfile.js
70+
2. Next go to the auth-server, and comment out the lines that were tracking the template which is longer referenced.
71+
72+
When you do these two steps what will happen is the languages strings in this library will be start being exported to the emails.ftl l10n translation file, and they will stop being exported to the auth.ftl translation file.
73+
74+
Having duplicate strings in these files is disruptive to our translators, so it's important we make the switch cleanly. Basically we want to ensure the l10n strings aren't being duplicated in the emails.ftl and auth.ftl files.

libs/accounts/email-renderer/gruntfile.js

Lines changed: 109 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,116 @@
1818
grunt.config('concat', {
1919
'emails-ftl': {
2020
src: [
21-
'src/**/en.ftl'
21+
// Until we have fully migrated all email sending off of auth-server, we will
22+
// maintain a list of ftl files to extract here. As we migrate over to using
23+
// the templates from this library, we should comment the template from this list,
24+
// and make sure that is commented out in auth server's list. Doing so will avoid
25+
// duplication of l10n strings, which causes our translators uncessary rework...
26+
27+
// Once all email rendering has been migrated, just use this pattern!
28+
// 'src/**/en.ftl',
29+
30+
'src/layouts/fxa/en.ftl',
31+
// 'src/subscription/fxa/en.ftl',
32+
33+
'src/partials/accountDeletionInfoBlock/en.ftl',
34+
'src/partials/appBadges/en.ftl',
35+
'src/partials/automatedEmailChangePassword/en.ftl',
36+
'src/partials/automatedEmailInactiveAccount/en.ftl',
37+
'src/partials/automatedEmailNoAction/en.ftl',
38+
'src/partials/automatedEmailNotAuthorized/en.ftl',
39+
'src/partials/automatedEmailRecoveryKey/en.ftl',
40+
'src/partials/automatedEmailResetPassword/en.ftl',
41+
'src/partials/automatedEmailResetPasswordTwoFactor/en.ftl',
42+
'src/partials/bannerWarning/en.ftl',
43+
'src/partials/brandMessaging/en.ftl',
44+
'src/partials/button/en.ftl',
45+
'src/partials/changePassword/en.ftl',
46+
// 'src/partials/icon/en.ftl',
47+
'src/partials/manageAccount/en.ftl',
48+
// 'src/partials/paymentPlanDetails/en.ftl',
49+
// 'src/partials/paymentProvider/en.ftl',
50+
// 'src/partials/subscriptionCharges/en.ftl',
51+
// 'src/partials/subscriptionSupport/en.ftl',
52+
// 'src/partials/subscriptionSupportContact/en.ftl',
53+
// 'src/partials/subscriptionSupportGetHelp/en.ftl',
54+
// 'src/partials/subscriptionUpdateBillingEnsure/en.ftl',
55+
// 'src/partials/subscriptionUpdateBillingTry/en.ftl',
56+
// 'src/partials/subscriptionUpdatePayment/en.ftl',
57+
'src/partials/support/en.ftl',
58+
'src/partials/userDevice/en.ftl',
59+
'src/partials/userInfo/en.ftl',
60+
'src/partials/userLocation/en.ftl',
61+
// 'src/partials/viewInvoice/en.ftl',
62+
63+
'src/templates/adminResetAccounts/en.ftl',
64+
'src/templates/cadReminderFirst/en.ftl',
65+
'src/templates/cadReminderSecond/en.ftl',
66+
// 'src/templates/downloadSubscription/en.ftl',
67+
// 'src/templates/fraudulentAccountDeletion/en.ftl',
68+
'src/templates/inactiveAccountFinalWarning/en.ftl',
69+
'src/templates/inactiveAccountFirstWarning/en.ftl',
70+
'src/templates/inactiveAccountSecondWarning/en.ftl',
71+
'src/templates/lowRecoveryCodes/en.ftl',
72+
'src/templates/newDeviceLogin/en.ftl',
73+
'src/templates/passwordChangeRequired/en.ftl',
74+
'src/templates/passwordChanged/en.ftl',
75+
'src/templates/passwordForgotOtp/en.ftl',
76+
'src/templates/passwordReset/en.ftl',
77+
'src/templates/passwordResetAccountRecovery/en.ftl',
78+
'src/templates/passwordResetRecoveryPhone/en.ftl',
79+
'src/templates/passwordResetWithRecoveryKeyPrompt/en.ftl',
80+
'src/templates/postAddAccountRecovery/en.ftl',
81+
'src/templates/postAddLinkedAccount/en.ftl',
82+
'src/templates/postAddRecoveryPhone/en.ftl',
83+
'src/templates/postAddTwoStepAuthentication/en.ftl',
84+
'src/templates/postChangeAccountRecovery/en.ftl',
85+
'src/templates/postChangePrimary/en.ftl',
86+
'src/templates/postChangeRecoveryPhone/en.ftl',
87+
'src/templates/postChangeTwoStepAuthentication/en.ftl',
88+
'src/templates/postConsumeRecoveryCode/en.ftl',
89+
'src/templates/postNewRecoveryCodes/en.ftl',
90+
'src/templates/postRemoveAccountRecovery/en.ftl',
91+
'src/templates/postRemoveRecoveryPhone/en.ftl',
92+
'src/templates/postRemoveSecondary/en.ftl',
93+
'src/templates/postRemoveTwoStepAuthentication/en.ftl',
94+
'src/templates/postSigninRecoveryCode/en.ftl',
95+
'src/templates/postSigninRecoveryPhone/en.ftl',
96+
'src/templates/postVerify/en.ftl',
97+
'src/templates/postVerifySecondary/en.ftl',
98+
'src/templates/recovery/en.ftl',
99+
// 'src/templates/subscriptionAccountDeletion/en.ftl',
100+
// 'src/templates/subscriptionAccountReminderFirst/en.ftl',
101+
// 'src/templates/subscriptionAccountReminderSecond/en.ftl',
102+
// 'src/templates/subscriptionCancellation/en.ftl',
103+
// 'src/templates/subscriptionDowngrade/en.ftl',
104+
// 'src/templates/subscriptionEndingReminder/en.ftl',
105+
// 'src/templates/subscriptionFailedPaymentsCancellation/en.ftl',
106+
// 'src/templates/subscriptionFirstInvoice/en.ftl',
107+
// 'src/templates/subscriptionPaymentExpired/en.ftl',
108+
// 'src/templates/subscriptionPaymentFailed/en.ftl',
109+
// 'src/templates/subscriptionPaymentProviderCancelled/en.ftl',
110+
// 'src/templates/subscriptionReactivation/en.ftl',
111+
// 'src/templates/subscriptionRenewalReminder/en.ftl',
112+
// 'src/templates/subscriptionReplaced/en.ftl',
113+
// 'src/templates/subscriptionSubsequentInvoice/en.ftl',
114+
// 'src/templates/subscriptionUpgrade/en.ftl',
115+
// 'src/templates/subscriptionsPaymentExpired/en.ftl',
116+
// 'src/templates/subscriptionsPaymentProviderCancelled/en.ftl',
117+
'src/templates/unblockCode/en.ftl',
118+
'src/templates/verificationReminderFinal/en.ftl',
119+
'src/templates/verificationReminderFirst/en.ftl',
120+
'src/templates/verificationReminderSecond/en.ftl',
121+
'src/templates/verify/en.ftl',
122+
'src/templates/verifyAccountChange/en.ftl',
123+
'src/templates/verifyLogin/en.ftl',
124+
'src/templates/verifyLoginCode/en.ftl',
125+
'src/templates/verifyPrimary/en.ftl',
126+
'src/templates/verifySecondaryCode/en.ftl',
127+
'src/templates/verifyShortCode/en.ftl',
22128
],
23-
dest: 'public/locales/en/emails.ftl'
24-
}
129+
dest: 'public/locales/en/emails.ftl',
130+
},
25131
});
26132

27133
grunt.config('watch', {

packages/fxa-auth-server/grunttasks/ftl.js

Lines changed: 112 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,118 @@ module.exports = function (grunt) {
1818

1919
grunt.config('concat', {
2020
ftl: {
21-
src: ['lib/l10n/server.ftl', 'lib/**/senders/emails/**/en.ftl'],
21+
src: [
22+
'lib/l10n/server.ftl',
23+
24+
// Until we have fully migrated all email sending off of auth-server, we will
25+
// maintain a list of ftl files to extract here. As we migrate over to using
26+
// the templates from this library, we should comment the template from this list,
27+
// and make sure that is commented out in auth server's list. Doing so will avoid
28+
// duplication of l10n strings, which causes our translators uncessary rework...
29+
30+
// Once all email rendering has been migrated, just use this pattern!
31+
// 'lib/senders/emails/**/en.ftl',
32+
33+
// 'lib/senders/emails/layouts/fxa/en.ftl',
34+
'lib/senders/emails/subscription/fxa/en.ftl',
35+
36+
// 'lib/senders/emails/partials/accountDeletionInfoBlock/en.ftl',
37+
// 'lib/senders/emails/partials/appBadges/en.ftl',
38+
// 'lib/senders/emails/partials/automatedEmailChangePassword/en.ftl',
39+
// 'lib/senders/emails/partials/automatedEmailInactiveAccount/en.ftl',
40+
// 'lib/senders/emails/partials/automatedEmailNoAction/en.ftl',
41+
// 'lib/senders/emails/partials/automatedEmailNotAuthorized/en.ftl',
42+
// 'lib/senders/emails/partials/automatedEmailRecoveryKey/en.ftl',
43+
// 'lib/senders/emails/partials/automatedEmailResetPassword/en.ftl',
44+
// 'lib/senders/emails/partials/automatedEmailResetPasswordTwoFactor/en.ftl',
45+
// 'lib/senders/emails/partials/bannerWarning/en.ftl',
46+
// 'lib/senders/emails/partials/brandMessaging/en.ftl',
47+
// 'lib/senders/emails/partials/button/en.ftl',
48+
// 'lib/senders/emails/partials/changePassword/en.ftl',
49+
// 'lib/senders/emails/partials/changePassword/en.ftl',
50+
'lib/senders/emails/partials/icon/en.ftl',
51+
// 'lib/senders/emails/partials/manageAccount/en.ftl',
52+
'lib/senders/emails/partials/paymentPlanDetails/en.ftl',
53+
'lib/senders/emails/partials/paymentProvider/en.ftl',
54+
'lib/senders/emails/partials/subscriptionCharges/en.ftl',
55+
'lib/senders/emails/partials/subscriptionSupport/en.ftl',
56+
'lib/senders/emails/partials/subscriptionSupportContact/en.ftl',
57+
'lib/senders/emails/partials/subscriptionSupportGetHelp/en.ftl',
58+
'lib/senders/emails/partials/subscriptionUpdateBillingEnsure/en.ftl',
59+
'lib/senders/emails/partials/subscriptionUpdateBillingTry/en.ftl',
60+
'lib/senders/emails/partials/subscriptionUpdatePayment/en.ftl',
61+
// 'lib/senders/emails/partials/support/en.ftl',
62+
// 'lib/senders/emails/partials/userDevice/en.ftl',
63+
// 'lib/senders/emails/partials/userInfo/en.ftl',
64+
// 'lib/senders/emails/partials/userLocation/en.ftl',
65+
'lib/senders/emails/partials/viewInvoice/en.ftl',
66+
67+
// 'lib/senders/emails/templates/adminResetAccounts/en.ftl',
68+
// 'lib/senders/emails/templates/cadReminderFirst/en.ftl',
69+
// 'lib/senders/emails/templates/cadReminderSecond/en.ftl',
70+
'lib/senders/emails/templates/downloadSubscription/en.ftl',
71+
'lib/senders/emails/templates/fraudulentAccountDeletion/en.ftl',
72+
// 'lib/senders/emails/templates/inactiveAccountFinalWarning/en.ftl',
73+
// 'lib/senders/emails/templates/inactiveAccountFirstWarning/en.ftl',
74+
// 'lib/senders/emails/templates/inactiveAccountSecondWarning/en.ftl',
75+
// 'lib/senders/emails/templates/lowRecoveryCodes/en.ftl',
76+
// 'lib/senders/emails/templates/newDeviceLogin/en.ftl',
77+
// 'lib/senders/emails/templates/passwordChangeRequired/en.ftl',
78+
// 'lib/senders/emails/templates/passwordChanged/en.ftl',
79+
// 'lib/senders/emails/templates/passwordForgotOtp/en.ftl',
80+
// 'lib/senders/emails/templates/passwordReset/en.ftl',
81+
// 'lib/senders/emails/templates/passwordResetAccountRecovery/en.ftl',
82+
// 'lib/senders/emails/templates/passwordResetRecoveryPhone/en.ftl',
83+
// 'lib/senders/emails/templates/passwordResetWithRecoveryKeyPrompt/en.ftl',
84+
// 'lib/senders/emails/templates/postAddAccountRecovery/en.ftl',
85+
// 'lib/senders/emails/templates/postAddLinkedAccount/en.ftl',
86+
// 'lib/senders/emails/templates/postAddRecoveryPhone/en.ftl',
87+
// 'lib/senders/emails/templates/postAddTwoStepAuthentication/en.ftl',
88+
// 'lib/senders/emails/templates/postChangeAccountRecovery/en.ftl',
89+
// 'lib/senders/emails/templates/postChangePrimary/en.ftl',
90+
// 'lib/senders/emails/templates/postChangeRecoveryPhone/en.ftl',
91+
// 'lib/senders/emails/templates/postChangeTwoStepAuthentication/en.ftl',
92+
// 'lib/senders/emails/templates/postConsumeRecoveryCode/en.ftl',
93+
// 'lib/senders/emails/templates/postNewRecoveryCodes/en.ftl',
94+
// 'lib/senders/emails/templates/postRemoveAccountRecovery/en.ftl',
95+
// 'lib/senders/emails/templates/postRemoveRecoveryPhone/en.ftl',
96+
// 'lib/senders/emails/templates/postRemoveSecondary/en.ftl',
97+
// 'lib/senders/emails/templates/postRemoveTwoStepAuthentication/en.ftl',
98+
// 'lib/senders/emails/templates/postSigninRecoveryCode/en.ftl',
99+
// 'lib/senders/emails/templates/postSigninRecoveryPhone/en.ftl',
100+
// 'lib/senders/emails/templates/postVerify/en.ftl',
101+
// 'lib/senders/emails/templates/postVerifySecondary/en.ftl',
102+
// 'lib/senders/emails/templates/recovery/en.ftl',
103+
'lib/senders/emails/templates/subscriptionAccountDeletion/en.ftl',
104+
'lib/senders/emails/templates/subscriptionAccountReminderFirst/en.ftl',
105+
'lib/senders/emails/templates/subscriptionAccountReminderSecond/en.ftl',
106+
'lib/senders/emails/templates/subscriptionCancellation/en.ftl',
107+
'lib/senders/emails/templates/subscriptionDowngrade/en.ftl',
108+
'lib/senders/emails/templates/subscriptionEndingReminder/en.ftl',
109+
'lib/senders/emails/templates/subscriptionFailedPaymentsCancellation/en.ftl',
110+
'lib/senders/emails/templates/subscriptionFirstInvoice/en.ftl',
111+
'lib/senders/emails/templates/subscriptionPaymentExpired/en.ftl',
112+
'lib/senders/emails/templates/subscriptionPaymentFailed/en.ftl',
113+
'lib/senders/emails/templates/subscriptionPaymentProviderCancelled/en.ftl',
114+
'lib/senders/emails/templates/subscriptionReactivation/en.ftl',
115+
'lib/senders/emails/templates/subscriptionRenewalReminder/en.ftl',
116+
'lib/senders/emails/templates/subscriptionReplaced/en.ftl',
117+
'lib/senders/emails/templates/subscriptionSubsequentInvoice/en.ftl',
118+
'lib/senders/emails/templates/subscriptionUpgrade/en.ftl',
119+
'lib/senders/emails/templates/subscriptionsPaymentExpired/en.ftl',
120+
'lib/senders/emails/templates/subscriptionsPaymentProviderCancelled/en.ftl',
121+
// 'lib/senders/emails/templates/unblockCode/en.ftl',
122+
// 'lib/senders/emails/templates/verificationReminderFinal/en.ftl',
123+
// 'lib/senders/emails/templates/verificationReminderFirst/en.ftl',
124+
// 'lib/senders/emails/templates/verificationReminderSecond/en.ftl',
125+
// 'lib/senders/emails/templates/verify/en.ftl',
126+
// 'lib/senders/emails/templates/verifyAccountChange/en.ftl',
127+
// 'lib/senders/emails/templates/verifyLogin/en.ftl',
128+
// 'lib/senders/emails/templates/verifyLoginCode/en.ftl',
129+
// 'lib/senders/emails/templates/verifyPrimary/en.ftl',
130+
// 'lib/senders/emails/templates/verifySecondaryCode/en.ftl',
131+
// 'lib/senders/emails/templates/verifyShortCode/en.ftl',
132+
],
22133
dest: 'public/locales/en/auth.ftl',
23134
},
24135
'ftl-test': {

0 commit comments

Comments
 (0)