Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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: add i18n for LighthouseError messages #6457
i18n: add i18n for LighthouseError messages #6457
Changes from 14 commits
d1be64d
6799fab
3db8628
b9c4b4e
9b6062b
b0d369f
1481b08
cf8e569
df29d17
020056a
56e3daf
e764e2d
7a65d02
a6cd8bc
02765e4
a991732
879c333
345d3e4
9a87b04
9beb615
bdfcc4e
c56c83f
9857760
d1e1943
c6cfb3b
14ceeb2
972ddb5
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
this is getting complex. Can we start doing early returns on these? Should be easier to read with those.
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.
maybe for some of these descriptions we should include for the translators the distinction of whether it was something weird that retrying should fix, or something that the user needs to fix and try again? I'm thinking a stock explanation.
This is an error message that was because of certain user conditions they must fix before retrying.
vs.
This is an error message that was because of irregularities with Lighthouse that should be fixed by trying again.
just spitballin'
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.
@patrickhulce @brendankenny is this what you had in mind?
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.
perfect 👌
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.
What if the second argument to the
LHError
constructor becomes the replacement values? I feel like it would be conceptually easier to understand without having all of it on the first argument andis a lot easier to understand at a glance than
I was going to say ideally we'd do this but the existing
properties
second arg makes that a problem, but I think it's actually fine. The only place we ever use that argument is in this file forfromProtocolMessage()
, and we use it forprotocolMethod
andprotocolError
, one of which is already an icu argument name :)What if
properties
just did both? It puts its properties on the error object (as it does now), and it gets passed intostr_
(aserrorDefinition
is doing 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 think later on we should do stricter type checking...if you use a string that needs a replacement, you should have to provide the replacement
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.
do we want defaults for these? What happens if you don't provide them? Throwing if you don't provide one seems ideal
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.
Yeah the ICU message translator throws. With a 'value that wasn't replaced', good point, we probably do want to throw in order to avoid a silent lack of real replacement.
This file was deleted.