-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
i18n: localize audit error strings #6812
Conversation
const errorMessage = err.friendlyMessage ? | ||
`${err.friendlyMessage} (${err.message})` : | ||
`Audit error: ${err.message}`; | ||
const errorMessage = err.friendlyMessage ? err.friendlyMessage : err.message; |
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.
so what errors do we start losing for the code for after this, just the speedline ones? or the page load ones too?
I agree there's not a strong need for our users to know the code, but having it somewhere in the LHR would be nice.
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 think we should follow the same pattern of splitting the speedline ones out into unique values.
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.
Nevermind all that. Let's do separate messages for these errors. :)
Okay, flip flopped again. I was about to split out all the speedline UIStrings, and then noticed all the pageLoadTookTooLong UIStrings which would also need to be split up afaik. So this seemed like it was getting ridiculous, so @brendankenny and I came to the compromise of providing the Thoughts? |
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.
sgtm
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.
LGTM!
Two last nits. The comment one probably wouldn't be worth another edit round on its own, but we probably should have the parens actually as parens in the test regex.
Summary
Audit errors were adding the message code to the end of the errorMessage with parens which was destroying the ICU replacement. This adds
defaultProperties
to easier facilitate mutliple LHErrors using the same UIString to replace and use their own defaults that are constant per error.Related Issues/PRs
fixes: #6804