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

Replaced i18n.t w/ tpl in v2/slugs.js (#13505)

refs: TryGhost#13380

- The i18n package is deprecated. It is being replaced with the tpl package.
This commit is contained in:
LucasOe 2021-10-08 16:41:10 +02:00 committed by GitHub
parent ace3ff033c
commit 1ceab9dea3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,7 +1,11 @@
const models = require('../../models');
const i18n = require('../../../shared/i18n');
const tpl = require('@tryghost/tpl');
const errors = require('@tryghost/errors');
const messages = {
couldNotGenerateSlug: 'Could not generate slug.'
};
const allowedTypes = {
post: models.Post,
tag: models.Tag,
@ -37,7 +41,7 @@ module.exports = {
.then((slug) => {
if (!slug) {
return Promise.reject(new errors.GhostError({
message: i18n.t('errors.api.slugs.couldNotGenerateSlug')
message: tpl(messages.couldNotGenerateSlug)
}));
}
return slug;