replaced i18n with tpl in mega of core services (#13546)

refs: #13380

- The i18n package is deprecated. It is being replaced with the tpl package.

Co-authored-by: jack.wu <jack.wu@wemoscooter.com>
This commit is contained in:
Jack Wu 2021-10-12 15:29:34 +08:00 committed by GitHub
parent c5459db52e
commit 65d5b8d671
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -6,7 +6,6 @@ const url = require('url');
const moment = require('moment');
const ObjectID = require('bson-objectid');
const errors = require('@tryghost/errors');
const i18n = require('../../../shared/i18n');
const logging = require('@tryghost/logging');
const settingsCache = require('../../../shared/settings-cache');
const membersService = require('../members');
@ -25,7 +24,8 @@ const messages = {
invalidSegment: 'Invalid segment value. Use one of the valid:"status:free" or "status:-free" values.',
unexpectedFilterError: 'Unexpected {property} value "{value}", expected an NQL equivalent',
noneFilterError: 'Cannot send email to "none" {property}',
emailSendingDisabled: `Email sending is temporarily disabled because your account is currently in review. You should have an email about this from us already, but you can also reach us any time at support@ghost.org`
emailSendingDisabled: `Email sending is temporarily disabled because your account is currently in review. You should have an email about this from us already, but you can also reach us any time at support@ghost.org`,
sendEmailRequestFailed: 'The email service was unable to send an email batch.'
};
const getFromAddress = () => {
@ -354,7 +354,7 @@ async function sendEmailJob({emailModel, options}) {
throw new errors.GhostError({
err: error,
context: i18n.t('errors.services.mega.requestFailed.error')
context: tpl(messages.sendEmailRequestFailed)
});
}
}