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

i18n: add i18n for LighthouseError messages #6457

Merged
merged 27 commits into from
Dec 10, 2018
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
d1be64d
Added i18n for runtime error messages.
exterkamp Nov 2, 2018
6799fab
Merge branch 'master' into i18n-errors
exterkamp Nov 2, 2018
3db8628
Formatting on substitutes.
exterkamp Nov 2, 2018
b9c4b4e
Removed redundant 'Method'.
exterkamp Nov 2, 2018
9b6062b
All backticks for variable interpolation highlighting
exterkamp Nov 2, 2018
b0d369f
Thanks linter!
exterkamp Nov 2, 2018
1481b08
Added substitution check to PROTOCOL_TIMEOUT.
exterkamp Nov 2, 2018
cf8e569
Using test-utils toBeDisplayString.
exterkamp Nov 2, 2018
df29d17
Added descriptive ICU names from feedback.
exterkamp Nov 5, 2018
020056a
Added Method back into test for protocol timeout.
exterkamp Nov 5, 2018
56e3daf
Removed unnecessary var.
exterkamp Nov 5, 2018
e764e2d
Fixed i18n of errors and added test to make sure it works!
exterkamp Nov 5, 2018
7a65d02
Better gather runner test comparison.
exterkamp Nov 5, 2018
a6cd8bc
Linter caught me slippin'
exterkamp Nov 5, 2018
02765e4
Moved icu args to properties.
exterkamp Nov 14, 2018
a991732
Merge branch 'master' into i18n-errors
exterkamp Nov 28, 2018
879c333
Added early exit. Fixed i18n punc. formatting.
exterkamp Nov 28, 2018
345d3e4
Collected new strings, and fixed sec-msg test.
exterkamp Nov 28, 2018
9a87b04
Formatting fix.
exterkamp Nov 28, 2018
9beb615
Fixed LR test.
exterkamp Nov 28, 2018
bdfcc4e
Removed backticks, and added localized test.
exterkamp Nov 28, 2018
c56c83f
I was led astray.
exterkamp Nov 28, 2018
9857760
Update lighthouse-core/test/runner-test.js
patrickhulce Nov 29, 2018
d1e1943
Switched up string templates.
exterkamp Nov 29, 2018
c6cfb3b
Merge branch 'i18n-errors' of github.com:GoogleChrome/lighthouse into…
exterkamp Nov 29, 2018
14ceeb2
Apply suggestions from code review
paulirish Dec 7, 2018
972ddb5
Updated strings and test.
exterkamp Dec 7, 2018
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
6 changes: 3 additions & 3 deletions lighthouse-core/gather/gather-runner.js
Original file line number Diff line number Diff line change
Expand Up @@ -161,13 +161,13 @@ class GatherRunner {
} else {
return new LHError(
LHError.errors.FAILED_DOCUMENT_REQUEST,
{errorDetails: `${netErr}`}
{errorDetails: netErr}
);
}
} else if (mainRecord.hasErrorStatusCode()) {
return new LHError(
LHError.errors.ERRORED_DOCUMENT_REQUEST,
{statusCode: `${mainRecord.statusCode}`}
{statusCode: mainRecord.statusCode.toString()}
exterkamp marked this conversation as resolved.
Show resolved Hide resolved
);
}
}
Expand All @@ -184,7 +184,7 @@ class GatherRunner {
.map(exp => exp.description);
throw new LHError(
LHError.errors.INSECURE_DOCUMENT_REQUEST,
{securityMessages: `${insecureDescriptions.join(' ')}`}
{securityMessages: insecureDescriptions.join(' ')}
);
}
}
Expand Down
4 changes: 2 additions & 2 deletions lighthouse-core/test/runner-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -625,8 +625,8 @@ describe('Runner', () => {
assert.fail('should have thrown');
} catch (err) {
assert.equal(err.code, LHError.errors.PROTOCOL_TIMEOUT.code);
assert.ok(/^Waiting for DevTools protocol.*Method: Method.Failure/.test(err.friendlyMessage),
'should have prevented run');
/* eslint-disable-next-line max-len */
expect(err.friendlyMessage).toBeDisplayString('Waiting for DevTools protocol response has exceeded the allotted time. Method: Method.Failure.');
exterkamp marked this conversation as resolved.
Show resolved Hide resolved
}
});

Expand Down