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

core(fcp-3g): remove unused i18n for LR compatibility #7103

Merged
merged 4 commits into from
Jan 29, 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
17 changes: 12 additions & 5 deletions lighthouse-core/audits/metrics/first-contentful-paint-3g.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,17 @@
const Audit = require('../audit.js');
const regular3G = require('../../config/constants.js').throttling.mobileRegluar3G;
const i18n = require('../../lib/i18n/i18n.js');
const FCP = require('./first-contentful-paint.js');
const ComputedFcp = require('../../computed/metrics/first-contentful-paint.js');

const i18nFilename = require.resolve('./first-contentful-paint.js');
const str_ = i18n.createMessageInstanceIdFn(i18nFilename, FCP.UIStrings);
const UIStrings = {
/** The name of the metric that marks the time at which the first text or image is painted by the browser, on a 3G network. Shown to users as the label for the numeric metric value. Ideally fits within a ~40 character limit. */
title: 'First Contentful Paint (3G)',
/** Description of the First Contentful Paint (FCP) metric, which marks the time at which the first text or image is painted by the browser. This is displayed within a tooltip when the user hovers on the metric name to see more. No character length limits. 'Learn More' becomes link text to additional documentation. */
description: 'First Contentful Paint 3G marks the time at which the first text or image is ' +
`painted while on a 3G network. [Learn more](https://developers.google.com/web/tools/lighthouse/audits/first-contentful-paint).`,
};

const str_ = i18n.createMessageInstanceIdFn(__filename, UIStrings);

class FirstContentfulPaint3G extends Audit {
/**
Expand All @@ -21,8 +27,8 @@ class FirstContentfulPaint3G extends Audit {
static get meta() {
return {
id: 'first-contentful-paint-3g',
title: str_(FCP.UIStrings.title),
description: str_(FCP.UIStrings.description),
title: str_(UIStrings.title),
description: str_(UIStrings.description),
scoreDisplayMode: Audit.SCORING_MODES.NUMERIC,
requiredArtifacts: ['traces', 'devtoolsLogs'],
};
Expand Down Expand Up @@ -66,3 +72,4 @@ class FirstContentfulPaint3G extends Audit {
}

module.exports = FirstContentfulPaint3G;
module.exports.UIStrings = UIStrings;
8 changes: 8 additions & 0 deletions lighthouse-core/lib/i18n/en-US.json
Original file line number Diff line number Diff line change
Expand Up @@ -675,6 +675,14 @@
"message": "Estimated Input Latency",
"description": "The name of the metric that marks the estimated time between the page receiving input (a user clicking, tapping, or typing) and the page responding. Shown to users as the label for the numeric metric value. Ideally fits within a ~40 character limit."
},
"lighthouse-core/audits/metrics/first-contentful-paint-3g.js | description": {
"message": "First Contentful Paint 3G marks the time at which the first text or image is painted while on a 3G network. [Learn more](https://developers.google.com/web/tools/lighthouse/audits/first-contentful-paint).",
"description": "Description of the First Contentful Paint (FCP) metric, which marks the time at which the first text or image is painted by the browser. This is displayed within a tooltip when the user hovers on the metric name to see more. No character length limits. 'Learn More' becomes link text to additional documentation."
},
"lighthouse-core/audits/metrics/first-contentful-paint-3g.js | title": {
"message": "First Contentful Paint (3G)",
"description": "The name of the metric that marks the time at which the first text or image is painted by the browser, on a 3G network. Shown to users as the label for the numeric metric value. Ideally fits within a ~40 character limit."
},
"lighthouse-core/audits/metrics/first-contentful-paint.js | description": {
"message": "First Contentful Paint marks the time at which the first text or image is painted. [Learn more](https://developers.google.com/web/tools/lighthouse/audits/first-contentful-paint).",
"description": "Description of the First Contentful Paint (FCP) metric, which marks the time at which the first text or image is painted by the browser. This is displayed within a tooltip when the user hovers on the metric name to see more. No character length limits. 'Learn More' becomes link text to additional documentation."
Expand Down