Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 fixed error message code for HB translate helper #15529

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions ghost/core/core/frontend/helpers/t.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,20 @@
// {{tags prefix=(t " on ")}}

const {themeI18n} = require('../services/handlebars');
const errors = require('@tryghost/errors');
const tpl = require('@tryghost/tpl');

const messages = {
oopsErrorTemplateHasError: 'Oops, seems there is an error in the template.'
};

module.exports = function t(text, options) {
if (text === undefined && options === undefined) {
throw new errors.IncorrectUsageError({
message: tpl(messages.oopsErrorTemplateHasError)
});
}

const bindings = {};
let prop;
for (prop in options.hash) {
Expand Down