0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-03-11 02:12:21 -05:00

Replace i18n with tpl in output/authentication.js (#13581)

refs: #13380

- The i18n package is deprecated. It is being replaced with the tpl package.
This commit is contained in:
PJ 2021-10-13 19:00:19 +11:00 committed by GitHub
parent 2c659ea447
commit 57ce743d98
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,6 +1,11 @@
const i18n = require('../../../../../../shared/i18n');
const tpl = require('@tryghost/tpl');
const mapper = require('./utils/mapper');
const debug = require('@tryghost/debug')('api:v2:utils:serializers:output:authentication');
const messages = {
checkEmailForInstructions: 'Check your email for further instructions.',
passwordChanged: 'Password changed successfully.',
invitationAccepted: 'Invitation accepted.'
};
module.exports = {
setup(user, apiConfig, frame) {
@ -28,7 +33,7 @@ module.exports = {
generateResetToken(data, apiConfig, frame) {
frame.response = {
passwordreset: [{
message: i18n.t('common.api.authentication.mail.checkEmailForInstructions')
message: tpl(messages.checkEmailForInstructions)
}]
};
},
@ -36,7 +41,7 @@ module.exports = {
resetPassword(data, apiConfig, frame) {
frame.response = {
passwordreset: [{
message: i18n.t('common.api.authentication.mail.passwordChanged')
message: tpl(messages.passwordChanged)
}]
};
},
@ -46,7 +51,7 @@ module.exports = {
frame.response = {
invitation: [
{message: i18n.t('common.api.authentication.mail.invitationAccepted')}
{message: tpl(messages.invitationAccepted)}
]
};
},