mirror of
https://github.com/wekan/wekan.git
synced 2025-12-16 15:30:13 +01:00
i18n-ize meteor email templates
This commit is contained in:
parent
8d5d7ee678
commit
892d1a2d45
3 changed files with 23 additions and 0 deletions
|
|
@ -51,4 +51,11 @@ if (Meteor.isServer) {
|
||||||
if (process.env.MAIL_FROM) {
|
if (process.env.MAIL_FROM) {
|
||||||
Accounts.emailTemplates.from = process.env.MAIL_FROM;
|
Accounts.emailTemplates.from = process.env.MAIL_FROM;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
['resetPassword-subject', 'resetPassword-text', 'verifyEmail-subject', 'verifyEmail-text', 'enrollAccount-subject', 'enrollAccount-text'].forEach((str) => {
|
||||||
|
const words = str.split('-');
|
||||||
|
Accounts.emailTemplates[words[0]][words[1]] = (user, url) => {
|
||||||
|
return TAPi18n.__(`email-${str}`, { user: user.getName(), url }, user.getLanguage());
|
||||||
|
};
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -124,6 +124,12 @@
|
||||||
"editLabelPopup-title": "Change Label",
|
"editLabelPopup-title": "Change Label",
|
||||||
"editProfilePopup-title": "Edit Profile",
|
"editProfilePopup-title": "Edit Profile",
|
||||||
"email": "Email",
|
"email": "Email",
|
||||||
|
"email-enrollAccount-subject": "An account created for you on __url__",
|
||||||
|
"email-enrollAccount-text": "Hello __user__,\n\nTo start using the service, simply click the link below.\n\n__url__\n\nThanks.\n",
|
||||||
|
"email-resetPassword-subject": "Reset your password on __url__",
|
||||||
|
"email-resetPassword-text": "Hello __user__,\n\nTo reset your password, simply click the link below.\n\n__url__\n\nThanks.\n",
|
||||||
|
"email-verifyEmail-subject": "Verify your email address on __url__",
|
||||||
|
"email-verifyEmail-text": "Hello __user__,\n\nTo verify your account email, simply click the link below.\n\n__url__\n\nThanks.\n",
|
||||||
"error-board-notAMember": "You need to be a member of this board to do that",
|
"error-board-notAMember": "You need to be a member of this board to do that",
|
||||||
"error-json-malformed": "Your text is not valid JSON",
|
"error-json-malformed": "Your text is not valid JSON",
|
||||||
"error-json-schema": "Your JSON data does not include the proper information in the correct format",
|
"error-json-schema": "Your JSON data does not include the proper information in the correct format",
|
||||||
|
|
|
||||||
|
|
@ -68,6 +68,16 @@ Users.helpers({
|
||||||
return this.username[0].toUpperCase();
|
return this.username[0].toUpperCase();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
getName() {
|
||||||
|
const profile = this.profile || {};
|
||||||
|
return profile.fullname || this.username;
|
||||||
|
},
|
||||||
|
|
||||||
|
getLanguage() {
|
||||||
|
const profile = this.profile || {};
|
||||||
|
return profile.language || 'en';
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
Users.mutations({
|
Users.mutations({
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue