Commit 3077cbf6 authored by Mandy Chen's avatar Mandy Chen Committed by Commit Bot

DevTools: Localize lighthouse strings when running audits

Currently lighthouse strings that are shown in the pop-up dialog when
running audits are not localized. This CL wraps them in ls and removes
the unnecessary localization calls.

Bug: 941561
Change-Id: I6296ecebaf46b216cb0259051065d1795303ba71
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1785500Reviewed-by: default avatarErik Luo <luoe@chromium.org>
Commit-Queue: Mandy Chen <mandy.chen@microsoft.com>
Cr-Commit-Position: refs/heads/master@{#694611}
parent b5a0a970
......@@ -143,7 +143,7 @@ Audits.StatusView = class {
*/
_getMessageForPhase(phase) {
if (phase.message)
return Common.UIString(phase.message);
return phase.message;
const deviceType = Audits.RuntimeSettings.find(item => item.setting.name === 'audits.device_type').setting.get();
const throttling = Audits.RuntimeSettings.find(item => item.setting.name === 'audits.throttling').setting.get();
......@@ -151,7 +151,7 @@ Audits.StatusView = class {
return item.deviceType === deviceType && item.throttling === throttling;
});
return match ? ls`${match.message}` : ls`Lighthouse is loading your page`;
return match ? match.message : ls`Lighthouse is loading your page`;
}
/**
......@@ -297,14 +297,14 @@ Audits.StatusView.StatusPhases = [
{
id: 'gathering',
progressBarClass: 'gathering',
message: 'Lighthouse is gathering information about the page to compute your score.',
message: ls`Lighthouse is gathering information about the page to compute your score.`,
statusMessagePrefix: 'Gathering',
order: 20,
},
{
id: 'auditing',
progressBarClass: 'auditing',
message: 'Almost there! Lighthouse is now generating your report.',
message: ls`Almost there! Lighthouse is now generating your report.`,
statusMessagePrefix: 'Auditing',
order: 30,
}
......@@ -315,42 +315,42 @@ Audits.StatusView.LoadingMessages = [
{
deviceType: 'mobile',
throttling: 'on',
message: 'Lighthouse is loading your page with throttling to measure performance on a mobile device on 3G.',
message: ls`Lighthouse is loading your page with throttling to measure performance on a mobile device on 3G.`,
},
{
deviceType: 'desktop',
throttling: 'on',
message: 'Lighthouse is loading your page with throttling to measure performance on a slow desktop on 3G.',
message: ls`Lighthouse is loading your page with throttling to measure performance on a slow desktop on 3G.`,
},
{
deviceType: 'mobile',
throttling: 'off',
message: 'Lighthouse is loading your page with mobile emulation.',
message: ls`Lighthouse is loading your page with mobile emulation.`,
},
{
deviceType: 'desktop',
throttling: 'off',
message: 'Lighthouse is loading your page.',
message: ls`Lighthouse is loading your page.`,
},
];
Audits.StatusView.FastFacts = [
'1MB takes a minimum of 5 seconds to download on a typical 3G connection [Source: WebPageTest and DevTools 3G definition].',
'Rebuilding Pinterest pages for performance increased conversion rates by 15% [Source: WPO Stats]',
'BBC has seen a loss of 10% of their users for every extra second of page load [Source: WPO Stats]',
'By reducing the response size of JSON needed for displaying comments, Instagram saw increased impressions [Source: WPO Stats]',
'Walmart saw a 1% increase in revenue for every 100ms improvement in page load [Source: WPO Stats]',
'If a site takes >1 second to become interactive, users lose attention, and their perception of completing the page task is broken [Source: Google Developers Blog]',
'75% of global mobile users in 2016 were on 2G or 3G [Source: GSMA Mobile]',
'The average user device costs less than 200 USD. [Source: International Data Corporation]',
'53% of all site visits are abandoned if page load takes more than 3 seconds [Source: Google DoubleClick blog]',
'19 seconds is the average time a mobile web page takes to load on a 3G connection [Source: Google DoubleClick blog]',
'14 seconds is the average time a mobile web page takes to load on a 4G connection [Source: Google DoubleClick blog]',
'70% of mobile pages take nearly 7 seconds for the visual content above the fold to display on the screen. [Source: Think with Google]',
'As page load time increases from one second to seven seconds, the probability of a mobile site visitor bouncing increases 113%. [Source: Think with Google]',
'As the number of elements on a page increases from 400 to 6,000, the probability of conversion drops 95%. [Source: Think with Google]',
'70% of mobile pages weigh over 1MB, 36% over 2MB, and 12% over 4MB. [Source: Think with Google]',
'Lighthouse only simulates mobile performance; to measure performance on a real device, try WebPageTest.org [Source: Lighthouse team]',
ls`1MB takes a minimum of 5 seconds to download on a typical 3G connection [Source: WebPageTest and DevTools 3G definition].`,
ls`Rebuilding Pinterest pages for performance increased conversion rates by 15% [Source: WPO Stats]`,
ls`BBC has seen a loss of 10% of their users for every extra second of page load [Source: WPO Stats]`,
ls`By reducing the response size of JSON needed for displaying comments, Instagram saw increased impressions [Source: WPO Stats]`,
ls`Walmart saw a 1% increase in revenue for every 100ms improvement in page load [Source: WPO Stats]`,
ls`If a site takes >1 second to become interactive, users lose attention, and their perception of completing the page task is broken [Source: Google Developers Blog]`,
ls`75% of global mobile users in 2016 were on 2G or 3G [Source: GSMA Mobile]`,
ls`The average user device costs less than 200 USD. [Source: International Data Corporation]`,
ls`53% of all site visits are abandoned if page load takes more than 3 seconds [Source: Google DoubleClick blog]`,
ls`19 seconds is the average time a mobile web page takes to load on a 3G connection [Source: Google DoubleClick blog]`,
ls`14 seconds is the average time a mobile web page takes to load on a 4G connection [Source: Google DoubleClick blog]`,
ls`70% of mobile pages take nearly 7 seconds for the visual content above the fold to display on the screen. [Source: Think with Google]`,
ls`As page load time increases from one second to seven seconds, the probability of a mobile site visitor bouncing increases 113%. [Source: Think with Google]`,
ls`As the number of elements on a page increases from 400 to 6,000, the probability of conversion drops 95%. [Source: Think with Google]`,
ls`70% of mobile pages weigh over 1MB, 36% over 2MB, and 12% over 4MB. [Source: Think with Google]`,
ls`Lighthouse only simulates mobile performance; to measure performance on a real device, try WebPageTest.org [Source: Lighthouse team]`,
];
/** @const */
......
......@@ -12,6 +12,9 @@
<message name="IDS_DEVTOOLS_0f39dfdd740bf99080ca83e56e2cfb4c" desc="Text in Audits Status View">
💡 <ph name="THIS__FASTFACTSQUEUED_FASTFACTINDEX_">$1s<ex>75% of global mobile users in 2016 were on 2G or 3G [Source: GSMA Mobile]</ex></ph>
</message>
<message name="IDS_DEVTOOLS_1076f1bac69647c846ac3b822b133518" desc="Fast fact in the pop-up dialog when lighthouse is running in the Audits panel">
The average user device costs less than 200 USD. [Source: International Data Corporation]
</message>
<message name="IDS_DEVTOOLS_1421c82f3616812789ac346b1638e39d" desc="Text of audits start button in Audits Start View">
Run audits
</message>
......@@ -24,21 +27,24 @@
<message name="IDS_DEVTOOLS_161bf73e31de6b8e3d856815473cbe1c" desc="Text of the timeline button in Audits Report Renderer">
View Trace
</message>
<message name="IDS_DEVTOOLS_169ece87d3c6b79c2c8d69892927857c" desc="Fast fact in the pop-up dialog when lighthouse is running in the Audits panel">
19 seconds is the average time a mobile web page takes to load on a 3G connection [Source: Google DoubleClick blog]
</message>
<message name="IDS_DEVTOOLS_17de62900ceac9101c8814b4c4874328" desc="Text in Audits Controller">
Apply mobile emulation during auditing
</message>
<message name="IDS_DEVTOOLS_193c4edb3ab576449959f6710e017a49" desc="Text in Audits Controller">
Typical DevTools throttling, with actual traffic shaping and CPU slowdown applied
</message>
<message name="IDS_DEVTOOLS_1c481aa99d081c32182011a758f73d33" desc="Text in Audits Status View">
<ph name="MATCH_MESSAGE">$1s<ex>Lighthouse is loading your page.</ex></ph>
</message>
<message name="IDS_DEVTOOLS_2046d43f4cc1f59c06f764da2ca2355a" desc="Status text in the Audits panel">
The print popup window is open. Please close it to continue.
</message>
<message name="IDS_DEVTOOLS_2310408a63388fe57e3a4177168a8798" desc="Text in Audits Controller">
Desktop
</message>
<message name="IDS_DEVTOOLS_24e8ca2483129261096ba8ba0fbcd247" desc="Fast fact in the pop-up dialog when lighthouse is running in the Audits panel">
70% of mobile pages take nearly 7 seconds for the visual content above the fold to display on the screen. [Source: Think with Google]
</message>
<message name="IDS_DEVTOOLS_2a96c07a6c11ca7add2b1ffde86efe25" desc="Text in Audits Controller">
Can only audit HTTP/HTTPS pages and Chrome extensions. Navigate to a different page to start an audit.
</message>
......@@ -57,6 +63,9 @@
<message name="IDS_DEVTOOLS_41fdb410354e76ef7674f98e1cc84c8f" desc="Text in Audits Start View labeling throttling configration control group">
Throttling
</message>
<message name="IDS_DEVTOOLS_47e2dbd37d8d524f5c4105a96db27b59" desc="Fast fact in the pop-up dialog when lighthouse is running in the Audits panel">
75% of global mobile users in 2016 were on 2G or 3G [Source: GSMA Mobile]
</message>
<message name="IDS_DEVTOOLS_48d24d11c7c71282366fe2007d4cee3b" desc="Text in Audits Controller">
Throttling is simulated, resulting in faster audit runs with similar measurement accuracy
</message>
......@@ -69,6 +78,15 @@
<message name="IDS_DEVTOOLS_56395991012586c2067aa7bcb5905b50" desc="Text in Audits Panel">
Cancelling
</message>
<message name="IDS_DEVTOOLS_56846b99d193dbbd252ddca10d29aff4" desc="Text when lighthouse is loading the page in the Audits panel">
Lighthouse is loading your page with throttling to measure performance on a mobile device on 3G.
</message>
<message name="IDS_DEVTOOLS_5a73519018eaaacb7882caf8f0971ac1" desc="Fast fact in the pop-up dialog when lighthouse is running in the Audits panel">
1MB takes a minimum of 5 seconds to download on a typical 3G connection [Source: WebPageTest and DevTools 3G definition].
</message>
<message name="IDS_DEVTOOLS_5f0c08bc61549e7455c9e8b46bfe9aa9" desc="Fast fact in the pop-up dialog when lighthouse is running in the Audits panel">
70% of mobile pages weigh over 1MB, 36% over 2MB, and 12% over 4MB. [Source: Think with Google]
</message>
<message name="IDS_DEVTOOLS_64a64ca70e7a909a5a96c07082070bfc" desc="Text of a DOM element in Audits Status View">
Ah, sorry! We ran into an error.
</message>
......@@ -84,9 +102,24 @@
<message name="IDS_DEVTOOLS_67aa731132e0e7bbabb1b3d3c363e7d6" desc="Help text in Audits Controller">
Multiple tabs are being controlled by the same service worker. Close your other tabs on the same origin to audit this page.
</message>
<message name="IDS_DEVTOOLS_6e394d18cb68d551f58fa35f4dfc70bb" desc="Fast fact in the pop-up dialog when lighthouse is running in the Audits panel">
As page load time increases from one second to seven seconds, the probability of a mobile site visitor bouncing increases 113%. [Source: Think with Google]
</message>
<message name="IDS_DEVTOOLS_72c4a2e545d220fd8c9ead876a59a89d" desc="Text in Audits Controller">
Is this page optimized for search engine results ranking
</message>
<message name="IDS_DEVTOOLS_73351c316c7866b1c5730af9c82b5ab3" desc="Text when lighthouse is loading the page in the Audits panel">
Lighthouse is loading your page with throttling to measure performance on a slow desktop on 3G.
</message>
<message name="IDS_DEVTOOLS_7387b82b5b5cbc317147961ff45142c5" desc="Fast fact in the pop-up dialog when lighthouse is running in the Audits panel">
Walmart saw a 1% increase in revenue for every 100ms improvement in page load [Source: WPO Stats]
</message>
<message name="IDS_DEVTOOLS_77d52e376f0c781e4f0d908f6d0b7ff2" desc="Fast fact in the pop-up dialog when lighthouse is running in the Audits panel">
Lighthouse only simulates mobile performance; to measure performance on a real device, try WebPageTest.org [Source: Lighthouse team]
</message>
<message name="IDS_DEVTOOLS_78b8123c78d60b80d6a09618ad56c2cb" desc="Fast fact in the pop-up dialog when lighthouse is running in the Audits panel">
Rebuilding Pinterest pages for performance increased conversion rates by 15% [Source: WPO Stats]
</message>
<message name="IDS_DEVTOOLS_7bd1e4f7363173e2c8329551ca4d38cc" desc="New audit item label in Audits Report Selector">
(new audit)
</message>
......@@ -102,9 +135,21 @@
<message name="IDS_DEVTOOLS_8fe967af0fb77d0261a6ead91bcd607f" desc="Text in Audits Controller">
Reset storage (localStorage, IndexedDB, etc) before auditing. (Good for performance &amp; PWA testing)
</message>
<message name="IDS_DEVTOOLS_9103edac10b1749db57ca27386ff29dc" desc="Text when lighthouse is loading the page in the Audits panel">
Lighthouse is loading your page.
</message>
<message name="IDS_DEVTOOLS_93c09fb3e06297a9b9504113fa5915ea" desc="Fast fact in the pop-up dialog when lighthouse is running in the Audits panel">
BBC has seen a loss of 10% of their users for every extra second of page load [Source: WPO Stats]
</message>
<message name="IDS_DEVTOOLS_9446a98ad14416153cc4d45ab8b531bf" desc="Text in Audits Controller">
Performance
</message>
<message name="IDS_DEVTOOLS_a3456af9cc3d7cf0c2e288f889f050b7" desc="Fast fact in the pop-up dialog when lighthouse is running in the Audits panel">
If a site takes &gt;1 second to become interactive, users lose attention, and their perception of completing the page task is broken [Source: Google Developers Blog]
</message>
<message name="IDS_DEVTOOLS_a99169b94755be554b65f8dcc2c2b842" desc="Text in the pop-up dialog when lighthouse is gathering information in the Audits panel">
Lighthouse is gathering information about the page to compute your score.
</message>
<message name="IDS_DEVTOOLS_b002a564ceda05dbdf012a48a145d0d3" desc="Status header in the Audits panel">
Printing
</message>
......@@ -114,6 +159,9 @@
<message name="IDS_DEVTOOLS_b1b01acb63f79615b05f6d816705d7d3" desc="Text in Audits Controller">
Does this page meet the standard of a Progressive Web App
</message>
<message name="IDS_DEVTOOLS_b29bb7427a05d89f1dae6ab5459e2d5c" desc="Fast fact in the pop-up dialog when lighthouse is running in the Audits panel">
By reducing the response size of JSON needed for displaying comments, Instagram saw increased impressions [Source: WPO Stats]
</message>
<message name="IDS_DEVTOOLS_bc28aa52ba5b534ad9d198157c375d67" desc="Text in Audits Controller">
Clear storage
</message>
......@@ -126,6 +174,9 @@
<message name="IDS_DEVTOOLS_c91c7b93c28cd18741b71f727ee81ee3" desc="Title of combo box in audits report selector">
Reports
</message>
<message name="IDS_DEVTOOLS_d2f618fd63c7c2028cd527f60e761bc6" desc="Text when lighthouse is loading the page in the Audits panel">
Lighthouse is loading your page with mobile emulation.
</message>
<message name="IDS_DEVTOOLS_d59048f21fd887ad520398ce677be586" desc="Text in Audits Start View">
Learn more
</message>
......@@ -138,13 +189,25 @@
<message name="IDS_DEVTOOLS_e0ac20adce6ffee48c7151b070aa5737" desc="Text in Audits Start View labeling device configration control group">
Device
</message>
<message name="IDS_DEVTOOLS_e339ef3bcd3e92466fa83dc21e690a5b" desc="Fast fact in the pop-up dialog when lighthouse is running in the Audits panel">
As the number of elements on a page increases from 400 to 6,000, the probability of conversion drops 95%. [Source: Think with Google]
</message>
<message name="IDS_DEVTOOLS_e499f5109f685235e6280179fe22beec" desc="Text that appears when user drag and drop something (for example, a file) in Audits Panel">
Drop audit file here
</message>
<message name="IDS_DEVTOOLS_e8e1638b0449b103a9fdcee6c12d700c" desc="Fast fact in the pop-up dialog when lighthouse is running in the Audits panel">
14 seconds is the average time a mobile web page takes to load on a 4G connection [Source: Google DoubleClick blog]
</message>
<message name="IDS_DEVTOOLS_e9fe69c2de7c38bbe442e38780d20081" desc="Fast fact in the pop-up dialog when lighthouse is running in the Audits panel">
53% of all site visits are abandoned if page load takes more than 3 seconds [Source: Google DoubleClick blog]
</message>
<message name="IDS_DEVTOOLS_ea4788705e6873b424c65e91c2846b19" desc="Text of the cancel button in Audits Status View">
Cancel
</message>
<message name="IDS_DEVTOOLS_ea60ba1496b05c6a5816fb75d0665c8d" desc="Text of a DOM element in Audits Status View">
If this issue is reproducible, please report it at the Lighthouse GitHub repo.
</message>
<message name="IDS_DEVTOOLS_f3ddea8173e7a06f7a6a5dadc234fd3d" desc="Text in the pop-up dialog when lighthouse is auditing in the Audits panel">
Almost there! Lighthouse is now generating your report.
</message>
</grit-part>
\ No newline at end of file
......@@ -121,6 +121,9 @@ Click the reload button <ph name="RELOADBUTTON">$3s<ex>reload</ex></ph> or hit <
<message name="IDS_DEVTOOLS_1b2c363066d5912ae8b27a1527f3d45e" desc="Text in Timeline Tree View of the Performance panel">
Group by Domain
</message>
<message name="IDS_DEVTOOLS_1c481aa99d081c32182011a758f73d33" desc="Duration text in the Performance panel">
<ph name="DURATIONTEXT">$1s<ex>100ms (at 200ms)</ex></ph>
</message>
<message name="IDS_DEVTOOLS_1e3eaaac8d3c9cffea8ee7f03a8a6121" desc="Text in Timeline UIUtils of the Performance panel">
DOMContentLoaded Event
</message>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment