You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Export all UIStrings in insight models, for external usage
We should have no i18n strings defined in insight component modules,
since Lighthouse (and any other future external usages) should be able
to utilize the exact same translated strings. This was already the case
for title/description, but now every translated string has been moved.
Bug: 388723721
Change-Id: Ic3e72acb4b697a225b102f64383660b5a0f275af
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/6227699
Auto-Submit: Connor Clark <[email protected]>
Reviewed-by: Jack Franklin <[email protected]>
Commit-Queue: Jack Franklin <[email protected]>
Reviewed-by: Adam Raine <[email protected]>
/** Title of an insight that provides details about why elements shift/move on the page. The causes for these shifts are referred to as culprits ("reasons"). */
15
21
title: 'Layout shift culprits',
16
22
/**
@@ -19,11 +25,53 @@ const UIStrings = {
19
25
*/
20
26
description:
21
27
'Layout shifts occur when elements move absent any user interaction. [Investigate the causes of layout shifts](https://web.dev/articles/optimize-cls), such as elements being added, removed, or their fonts changing as the page loads.',
28
+
/**
29
+
*@description Text indicating the worst layout shift cluster.
* @description Title of an insight that recommends reducing the size of the DOM tree as a means to improve page responsiveness. "DOM" is an acronym and should not be translated.
15
21
*/
@@ -19,10 +25,34 @@ const UIStrings = {
19
25
*/
20
26
description:
21
27
'A large DOM can increase the duration of style calculations and layout reflows, impacting page responsiveness. A large DOM will also increase memory usage. [Learn how to avoid an excessive DOM size](https://developer.chrome.com/docs/lighthouse/performance/dom-size/).',
28
+
/**
29
+
* @description Header for a column containing the names of statistics as opposed to the actual statistic values.
30
+
*/
31
+
statistic: 'Statistic',
32
+
/**
33
+
* @description Header for a column containing the value of a statistic.
34
+
*/
35
+
value: 'Value',
36
+
/**
37
+
* @description Header for a column containing the page element related to a statistic.
38
+
*/
39
+
element: 'Element',
40
+
/**
41
+
* @description Label for a value representing the total number of elements on the page.
42
+
*/
43
+
totalElements: 'Total elements',
44
+
/**
45
+
* @description Label for a value representing the maximum depth of the Document Object Model (DOM). "DOM" is a acronym and should not be translated.
46
+
*/
47
+
maxDOMDepth: 'DOM depth',
48
+
/**
49
+
* @description Label for a value representing the maximum number of child elements of any parent element on the page.
Copy file name to clipboardExpand all lines: front_end/models/trace/insights/DocumentLatency.ts
+52-5Lines changed: 52 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -11,10 +11,11 @@ import {
11
11
typeInsightModel,
12
12
typeInsightSetContext,
13
13
InsightWarning,
14
+
typePartialInsightModel,
14
15
typeRequiredData
15
16
}from'./types.js';
16
17
17
-
constUIStrings={
18
+
exportconstUIStrings={
18
19
/**
19
20
*@description Title of an insight that provides a breakdown for how long it took to download the main document.
20
21
*/
@@ -24,10 +25,56 @@ const UIStrings = {
24
25
*/
25
26
description:
26
27
'Your first network request is the most important. Reduce its latency by avoiding redirects, ensuring a fast server response, and enabling text compression.',
28
+
/**
29
+
* @description Text to tell the user that the document request does not have redirects.
30
+
*/
31
+
passingRedirects: 'Avoids redirects',
32
+
/**
33
+
* @description Text to tell the user that the document request had redirects.
34
+
*/
35
+
failedRedirects: 'Had redirects',
36
+
/**
37
+
* @description Text to tell the user that the time starting the document request to when the server started responding is acceptable.
/** Title of an insight that provides details about the fonts used on the page, and the value of their `font-display` properties. */
14
20
title: 'Font display',
15
21
/**
16
22
* @description Text to tell the user about the font-display CSS feature to help improve a the UX of a page.
17
23
*/
18
24
description:
19
25
'Consider setting [`font-display`](https://developer.chrome.com/blog/font-display) to `swap` or `optional` to ensure text is consistently visible. `swap` can be further optimized to mitigate layout shifts with [font metric overrides](https://developer.chrome.com/blog/font-fallbacks).',
26
+
/** Column for a font loaded by the page to render text. */
Copy file name to clipboardExpand all lines: front_end/models/trace/insights/ForcedReflow.ts
+18-5Lines changed: 18 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -13,14 +13,15 @@ import {
13
13
typeForcedReflowAggregatedData,
14
14
InsightCategory,
15
15
typeInsightModel,
16
+
typePartialInsightModel,
16
17
typeRequiredData,
17
18
}from'./types.js';
18
19
19
20
exportfunctiondeps(): ['Warnings','Renderer']{
20
21
return['Warnings','Renderer'];
21
22
}
22
23
23
-
constUIStrings={
24
+
exportconstUIStrings={
24
25
/**
25
26
*@description Title of an insight that provides details about Forced reflow.
26
27
*/
@@ -30,12 +31,24 @@ const UIStrings = {
30
31
*/
31
32
description:
32
33
'Many APIs, typically reading layout geometry, force the rendering engine to pause script execution in order to calculate the style and layout. Learn more about [forced reflow](https://developers.google.com/web/fundamentals/performance/rendering/avoid-large-complex-layouts-and-layout-thrashing#avoid-forced-synchronous-layouts) and its mitigations.',
34
+
/**
35
+
*@description Title of a list to provide related stack trace data
36
+
*/
37
+
relatedStackTrace: 'Stack trace',
38
+
/**
39
+
*@description Text to describe the top time-consuming function call
40
+
*/
41
+
topTimeConsumingFunctionCall: 'Top function call',
42
+
/**
43
+
* @description Text to describe the total reflow time
0 commit comments