-
Notifications
You must be signed in to change notification settings - Fork 24
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
STRF-9124 Create an endpoint for precaching lang helper function #235
Conversation
index.js
Outdated
@@ -286,9 +286,18 @@ class Paper { | |||
* | |||
* @param {Object} templats | |||
*/ | |||
addTemplates(templates) { | |||
addTemplates(templates) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🍹 extra space at beginning of line
if (err.name === 'SyntaxError') { | ||
this.logger.error(`Syntax Error during Formatter function precompilation: ${err.message} for key "${key}"`, err.expected); | ||
|
||
return () => ''; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this not a situation where we want to also throw an error? Why do we just want to return empty string here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure why it was there, I've just used the same logic as it was at current helper implementation to have compatibility
lib/translator/index.js
Outdated
@@ -104,14 +153,22 @@ Translator.prototype.getLocale = function () { | |||
* @param {string} [keyFilter] | |||
* @returns {Object} Language object | |||
*/ | |||
Translator.prototype.getLanguage = function (keyFilter) { | |||
Translator.prototype.getLanguage = function (keyFilter) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🍹 Extra space
No description provided.