<commit_before>const Promise = require('bluebird');
const debug = require('@tryghost/debug')('api:v2:utils:validators:input:users');
const i18n = require('../../../../../../shared/i18n');
const errors = require('@tryghost/errors');

module.exports = {
    changePassword(apiConfig, frame) {
        debug('changePassword');

        const data = frame.data.password[0];

        if (data.newPassword !== data.ne2Password) {
            return Promise.reject(new errors.ValidationError({
                message: i18n.t('errors.models.user.newPasswordsDoNotMatch')
            }));
        }
    }
};
<commit_msg>Replace i18n with tpl in api/v2/utils/validators/input/users.js (#13589)<commit_after>const Promise = require('bluebird');
const debug = require('@tryghost/debug')('api:v2:utils:validators:input:users');
const tpl = require('@tryghost/tpl');
const errors = require('@tryghost/errors');
const messages = {
    newPasswordsDoNotMatch: 'Your new passwords do not match'
};

module.exports = {
    changePassword(apiConfig, frame) {
        debug('changePassword');

        const data = frame.data.password[0];

        if (data.newPassword !== data.<PASSWORD>) {
            return Promise.reject(new errors.ValidationError({
                message: tpl(messages.newPasswordsDoNotMatch)
            }));
        }
    }
};

{'fraction_non_alphanumeric': 0.15742128935532235, 'fraction_numerical': 0.01424287856071964, 'mean_word_length': 3.171875, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7314538', 'n_tokens_mistral': 407, 'n_tokens_neox': 393, 'n_words': 69}