-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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(report): runtime settings and tools #9166
Merged
Merged
Changes from 28 commits
Commits
Show all changes
32 commits
Select commit
Hold shift + click to select a range
52030ca
i18n runtime settings & dropdown. Modify ui-feat for i18n.
exterkamp ab5b189
Wrongly added this localeString mod
exterkamp df92054
Messed up some HTML while editing the strings.
exterkamp e6a7d32
Ignore report-ui-feat from collect-strings. Update proto, update sam…
exterkamp 5a5f2c0
stringback
exterkamp e469d64
this -> Util
exterkamp 670ef5e
Add proto comments.
exterkamp 341b858
convert \t to _ because regex is hard
exterkamp 4664a5f
Merge branch 'master' into i18n-report
exterkamp 5f1ec69
collected en-XL
exterkamp 03afb96
Merge branch 'master' into i18n-report
exterkamp 78444a7
Merge branch 'master' into i18n-report
exterkamp 62b3ba1
let -> const
exterkamp e683ebd
updated id's
exterkamp d5135a0
Merge branch 'master' into i18n-report
exterkamp 1676f8a
Added caching/hydration to Util
exterkamp a785482
hm, not sure how that worked, but okay
exterkamp a0c7c91
Merge branch 'master' into i18n-report
exterkamp d8916e7
Merge branch 'master' into i18n-report
exterkamp eff2c46
net -> network
exterkamp 37732a6
data-i18n attr
exterkamp c7b5083
update sample json
exterkamp ef3549d
keyof!
exterkamp 52abf75
forEach -> for of
exterkamp 0bac2c4
add test
exterkamp d4d35a3
Connor's nits
exterkamp ccdba60
Remove backup English from html, remove useless ignorePaths
exterkamp 3301b18
Merge branch 'i18n-report' of github.com:GoogleChrome/lighthouse into…
exterkamp 4c89c0f
fix tests
exterkamp ee5bab0
Merge remote-tracking branch 'origin/master' into i18n-report
exterkamp d5aa83c
Revert "fix tests"
exterkamp 551886b
ignore axe link-name
exterkamp File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -372,69 +372,66 @@ class Util { | |
|
||
return [ | ||
{ | ||
name: 'Device', | ||
name: Util.i18n.strings.runtimeSettingsDevice, | ||
description: emulationDesc.deviceEmulation, | ||
}, | ||
{ | ||
name: 'Network throttling', | ||
name: Util.i18n.strings.runtimeSettingsNetworkThrottling, | ||
description: emulationDesc.networkThrottling, | ||
}, | ||
{ | ||
name: 'CPU throttling', | ||
name: Util.i18n.strings.runtimeSettingsCPUThrottling, | ||
description: emulationDesc.cpuThrottling, | ||
}, | ||
]; | ||
} | ||
|
||
/** | ||
* @param {LH.Config.Settings} settings | ||
* @return {{deviceEmulation: string, networkThrottling: string, cpuThrottling: string, summary: string}} | ||
* @return {{deviceEmulation: string, networkThrottling: string, cpuThrottling: string}} | ||
*/ | ||
static getEmulationDescriptions(settings) { | ||
let cpuThrottling; | ||
let networkThrottling; | ||
let summary; | ||
|
||
const throttling = settings.throttling; | ||
|
||
switch (settings.throttlingMethod) { | ||
case 'provided': | ||
cpuThrottling = 'Provided by environment'; | ||
networkThrottling = 'Provided by environment'; | ||
summary = 'No throttling applied'; | ||
cpuThrottling = Util.i18n.strings.throttlingProvided; | ||
networkThrottling = Util.i18n.strings.throttlingProvided; | ||
break; | ||
case 'devtools': { | ||
const {cpuSlowdownMultiplier, requestLatencyMs} = throttling; | ||
cpuThrottling = `${Util.i18n.formatNumber(cpuSlowdownMultiplier)}x slowdown (DevTools)`; | ||
networkThrottling = `${Util.i18n.formatNumber(requestLatencyMs)}${NBSP}ms HTTP RTT, ` + | ||
`${Util.i18n.formatNumber(throttling.downloadThroughputKbps)}${NBSP}Kbps down, ` + | ||
`${Util.i18n.formatNumber(throttling.uploadThroughputKbps)}${NBSP}Kbps up (DevTools)`; | ||
summary = 'Throttled Slow 4G network'; | ||
break; | ||
} | ||
case 'simulate': { | ||
const {cpuSlowdownMultiplier, rttMs, throughputKbps} = throttling; | ||
cpuThrottling = `${Util.i18n.formatNumber(cpuSlowdownMultiplier)}x slowdown (Simulated)`; | ||
networkThrottling = `${Util.i18n.formatNumber(rttMs)}${NBSP}ms TCP RTT, ` + | ||
`${Util.i18n.formatNumber(throughputKbps)}${NBSP}Kbps throughput (Simulated)`; | ||
summary = 'Simulated Slow 4G network'; | ||
break; | ||
} | ||
default: | ||
cpuThrottling = 'Unknown'; | ||
networkThrottling = 'Unknown'; | ||
summary = 'Unknown'; | ||
cpuThrottling = Util.i18n.strings.runtimeUnknown; | ||
networkThrottling = Util.i18n.strings.runtimeUnknown; | ||
} | ||
|
||
let deviceEmulation = 'No emulation'; | ||
if (settings.emulatedFormFactor === 'mobile') deviceEmulation = 'Emulated Nexus 5X'; | ||
if (settings.emulatedFormFactor === 'desktop') deviceEmulation = 'Emulated Desktop'; | ||
let deviceEmulation = Util.i18n.strings.runtimeNoEmulation; | ||
if (settings.emulatedFormFactor === 'mobile') { | ||
deviceEmulation = Util.i18n.strings.runtimeMobileEmulation; | ||
} else if (settings.emulatedFormFactor === 'desktop') { | ||
deviceEmulation = Util.i18n.strings.runtimeDesktopEmulation; | ||
} | ||
|
||
return { | ||
deviceEmulation, | ||
cpuThrottling, | ||
networkThrottling, | ||
summary: `${deviceEmulation}, ${summary}`, | ||
}; | ||
} | ||
|
||
|
@@ -540,6 +537,57 @@ Util.UIStrings = { | |
|
||
/** This label is for a checkbox above a table of items loaded by a web page. The checkbox is used to show or hide third-party (or "3rd-party") resources in the table, where "third-party resources" refers to items loaded by a web page from URLs that aren't controlled by the owner of the web page. */ | ||
thirdPartyResourcesLabel: 'Show 3rd-party resources', | ||
|
||
/** Option in a dropdown menu that opens a small, summary report in a print dialog. */ | ||
dropdownPrintSummary: 'Print Summary', | ||
/** Option in a dropdown menu that opens a full Lighthouse report in a print dialog. */ | ||
dropdownPrintExpanded: 'Print Expanded', | ||
/** Option in a dropdown menu that copies the Lighthouse JSON object to the system clipboard. */ | ||
dropdownCopyJSON: 'Copy JSON', | ||
/** Option in a dropdown menu that saves the Lighthouse report HTML locally to the system as a '.html' file. */ | ||
dropdownSaveHTML: 'Save as HTML', | ||
/** Option in a dropdown menu that saves the Lighthouse JSON object to the local system as a '.json' file. */ | ||
dropdownSaveJSON: 'Save as JSON', | ||
/** Option in a dropdown menu that opens the current report in the Lighthouse Viewer Application. */ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. LVA, I like it 😎 |
||
dropdownViewer: 'Open in Viewer', | ||
/** Option in a dropdown menu that saves the current report as a new Github Gist. */ | ||
dropdownSaveGist: 'Save as Gist', | ||
/** Option in a dropdown menu that toggles the themeing of the report between Light(default) and Dark themes. */ | ||
dropdownDarkTheme: 'Toggle Dark Theme', | ||
|
||
/** Title of the Runtime settings table in a Lighthouse report. Runtime settings are the environment configurations that a specific report used at auditing time. */ | ||
runtimeSettingsTitle: 'Runtime Settings', | ||
/** Label for a row in a table that shows the URL that was audited during a Lighthouse run. */ | ||
runtimeSettingsUrl: 'URL', | ||
/** Label for a row in a table that shows the time at which a Lighthouse run was conducted; formatted as a timestamp, e.g. Jan 1, 1970 12:00 AM UTC. */ | ||
runtimeSettingsFetchTime: 'Fetch Time', | ||
/** Label for a row in a table that describes the kind of device that was emulated for the Lighthouse run. Example values for row elements: 'No Emulation', 'Emulated Desktop', etc. */ | ||
runtimeSettingsDevice: 'Device', | ||
/** Label for a row in a table that describes the network throttling conditions that were used during a Lighthouse run, if any. */ | ||
runtimeSettingsNetworkThrottling: 'Network throttling', | ||
/** Label for a row in a table that describes the CPU throttling conditions that were used during a Lighthouse run, if any.*/ | ||
runtimeSettingsCPUThrottling: 'CPU throttling', | ||
/** Label for a row in a table that shows the User Agent that was detected on the Host machine that ran Lighthouse. */ | ||
runtimeSettingsUA: 'User agent (host)', | ||
/** Label for a row in a table that shows the User Agent that was used to send out all network requests during the Lighthouse run. */ | ||
runtimeSettingsUANetwork: 'User agent (network)', | ||
/** Label for a row in a table that shows the estimated CPU power of the machine running Lighthouse. Example row values: 532, 1492, 783. */ | ||
runtimeSettingsBenchmark: 'CPU/Memory Power', | ||
|
||
/** Label for button to create an issue against the Lighthouse Github project. */ | ||
footerIssue: 'File an issue', | ||
|
||
/** Descriptive explanation for emulation setting when no device emulation is set. */ | ||
runtimeNoEmulation: 'No emulation', | ||
/** Descriptive explanation for emulation setting when emulating a Nexus 5X mobile device. */ | ||
runtimeMobileEmulation: 'Emulated Nexus 5X', | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. heads up Moto G4 conflict ahead :) #10191 |
||
/** Descriptive explanation for emulation setting when emulating a generic desktop form factor, as opposed to a mobile-device like form factor. */ | ||
runtimeDesktopEmulation: 'Emulated Desktop', | ||
/** Descriptive explanation for a runtime setting that is set to an unknown value. */ | ||
runtimeUnknown: 'Unknown', | ||
|
||
/** Descriptive explanation for environment throttling that was provided by the runtime environment instead of provided by Lighthouse throttling. */ | ||
throttlingProvided: 'Provided by environment', | ||
}; | ||
|
||
if (typeof module !== 'undefined' && module.exports) { | ||
|
Oops, something went wrong.
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.
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.
did we just not use this? 😆
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.
Oh yeah forgot to mention, we removed this in the new report redesign. It was on the top header, but no more!