[go: nahoru, domu]

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: perf-budget and res-summary column headers #9127

Merged
merged 5 commits into from
Jun 7, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
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
16 changes: 12 additions & 4 deletions lighthouse-core/audits/performance-budget.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,14 @@ const UIStrings = {
=1 {1 request}
other {# requests}
}`,
/** Table column header for classifying website resources by type, example: "Scripts", "Third-Party", "Stylesheet". */
columnResourceType: 'Resource Type',
/** Table column header for the count of requests made per resource type. */
columnRequests: 'Requests',
/** Table column header for the sizes of all network requests of a specific type. */
columnTransferSize: 'Transfer Size',
exterkamp marked this conversation as resolved.
Show resolved Hide resolved
/** Table column header for how displaying how much larger the size of network requests were than a predetermined budget. */
exterkamp marked this conversation as resolved.
Show resolved Hide resolved
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
/** Table column header for how displaying how much larger the size of network requests were than a predetermined budget. */
/** Table column header displaying: how much greater the quantity of network requests were than a predetermined budget, how much larger the size of network requests were than a predetermined budget. */

Copy link
Member Author

Choose a reason for hiding this comment

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

Integrated this with the column format from i18n.js

columnOverBudget: 'Over Budget',
};

const str_ = i18n.createMessageInstanceIdFn(__filename, UIStrings);
Expand Down Expand Up @@ -130,11 +138,11 @@ class ResourceBudget extends Audit {

/** @type { LH.Audit.Details.Table['headings'] } */
const headers = [
{key: 'label', itemType: 'text', text: 'Resource Type'},
{key: 'requestCount', itemType: 'numeric', text: 'Requests'},
{key: 'size', itemType: 'bytes', text: 'Transfer Size'},
{key: 'label', itemType: 'text', text: str_(UIStrings.columnResourceType)},
{key: 'requestCount', itemType: 'numeric', text: str_(UIStrings.columnRequests)},
{key: 'size', itemType: 'bytes', text: str_(UIStrings.columnTransferSize)},
{key: 'countOverBudget', itemType: 'text', text: ''},
{key: 'sizeOverBudget', itemType: 'bytes', text: 'Over Budget'},
{key: 'sizeOverBudget', itemType: 'bytes', text: str_(UIStrings.columnOverBudget)},
];

return {
Expand Down
16 changes: 16 additions & 0 deletions lighthouse-core/lib/i18n/en-US.json
Original file line number Diff line number Diff line change
Expand Up @@ -759,6 +759,22 @@
"message": "Server Backend Latencies",
"description": "Descriptive title of a Lighthouse audit that tells the user the server latencies observed from each origin the page connected to. This is displayed in a list of audit titles that Lighthouse generates."
},
"lighthouse-core/audits/performance-budget.js | columnOverBudget": {
"message": "Over Budget",
"description": "Table column header for how displaying how much larger the size of network requests were than a predetermined budget."
},
"lighthouse-core/audits/performance-budget.js | columnRequests": {
"message": "Requests",
"description": "Table column header for the count of requests made per resource type."
},
"lighthouse-core/audits/performance-budget.js | columnResourceType": {
"message": "Resource Type",
"description": "Table column header for classifying website resources by type, example: \"Scripts\", \"Third-Party\", \"Stylesheet\"."
},
"lighthouse-core/audits/performance-budget.js | columnTransferSize": {
"message": "Transfer Size",
"description": "Table column header for the sizes of all network requests of a specific type."
},
"lighthouse-core/audits/performance-budget.js | description": {
"message": "Keep the quantity and size of network requests under the targets set by the provided performance budget. [Learn more](https://developers.google.com/web/tools/lighthouse/audits/budgets).",
"description": "Description of a Lighthouse audit where a user sets budgets for the quantity and size of page resources. No character length limits. 'Learn More' becomes link text to additional documentation."
Expand Down
12 changes: 12 additions & 0 deletions lighthouse-core/test/results/sample_v2.json
Original file line number Diff line number Diff line change
Expand Up @@ -5268,6 +5268,18 @@
"lighthouse-core/audits/performance-budget.js | description": [
"audits[performance-budget].description"
],
"lighthouse-core/audits/performance-budget.js | columnResourceType": [
"audits[performance-budget].details.headings[0].text"
],
"lighthouse-core/audits/performance-budget.js | columnRequests": [
"audits[performance-budget].details.headings[1].text"
],
"lighthouse-core/audits/performance-budget.js | columnTransferSize": [
"audits[performance-budget].details.headings[2].text"
],
"lighthouse-core/audits/performance-budget.js | columnOverBudget": [
"audits[performance-budget].details.headings[4].text"
],
"lighthouse-core/lib/i18n/i18n.js | scriptResourceType": [
"audits[performance-budget].details.items[0].label",
"audits[resource-summary].details.items[1].label"
Expand Down