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

STRF-9124 Create an endpoint for precaching lang helper function #235

Merged
merged 1 commit into from
May 18, 2021

Conversation

jairo-bc
Copy link
Contributor

@jairo-bc jairo-bc commented May 7, 2021

No description provided.

index.js Outdated
@@ -286,9 +286,18 @@ class Paper {
*
* @param {Object} templats
*/
addTemplates(templates) {
addTemplates(templates) {
Copy link
Contributor

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 () => '';
Copy link
Contributor

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?

Copy link
Contributor Author

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

@@ -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) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🍹 Extra space

@junedkazi junedkazi merged commit b345588 into bigcommerce:master May 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants