i18n: seo strings prepped for i18n (#6860)
This commit is contained in:
Родитель
e6dbefa15c
Коммит
429008054d
|
@ -100,7 +100,7 @@ module.exports = [
|
|||
'font-size': {
|
||||
rawValue: false,
|
||||
explanation:
|
||||
'Text is illegible because there\'s no viewport meta tag optimized for mobile screens',
|
||||
'Text is illegible because there\'s no viewport meta tag optimized for mobile screens.',
|
||||
},
|
||||
'link-text': {
|
||||
score: 0,
|
||||
|
|
|
@ -10,6 +10,32 @@ const LinkHeader = require('http-link-header');
|
|||
const URL = require('../../lib/url-shim');
|
||||
const MainResource = require('../../computed/main-resource.js');
|
||||
const LINK_HEADER = 'link';
|
||||
const i18n = require('../../lib/i18n/i18n.js');
|
||||
|
||||
const UIStrings = {
|
||||
/** Title of a Lighthouse audit that provides detail on a page's rel=canonical link. This descriptive title is shown to users when the rel=canonical link is valid. "rel=canonical" is an HTML attribute and value and so should not be translated. */
|
||||
title: 'Document has a valid `rel=canonical`',
|
||||
/** Title of a Lighthouse audit that provides detail on a page's rel=canonical link. This descriptive title is shown to users when the rel=canonical link is invalid and should be fixed. "rel=canonical" is an HTML attribute and value and so should not be translated. */
|
||||
failureTitle: 'Document does not have a valid `rel=canonical`',
|
||||
/** Description of a Lighthouse audit that tells the user *why* they need to have a valid rel=canonical link. This is displayed after a user expands the section to see more. No character length limits. 'Learn More' becomes link text to additional documentation. */
|
||||
description: 'Canonical links suggest which URL to show in search results. ' +
|
||||
'[Learn more](https://developers.google.com/web/tools/lighthouse/audits/canonical).',
|
||||
/** [ICU Syntax] Explanatory message stating that there was a failure in an audit caused by multiple URLs conflicting with each other. "urlList" will be replaced by a list of URLs (e.g. https://example.com, https://example2.com, etc ). */
|
||||
explanationConflict: 'Multiple conflicting URLs ({urlList})',
|
||||
/** [ICU Syntax] Explanatory message stating that there was a failure in an audit caused by a URL being invalid. "url" will be replaced by the invalid URL (e.g. https://example.com). */
|
||||
explanationInvalid: 'Invalid URL ({url})',
|
||||
/** [ICU Syntax] Explanatory message stating that there was a failure in an audit caused by a URL being relative instead of absolute. "url" will be replaced by the invalid URL (e.g. https://example.com). */
|
||||
explanationRelative: 'Relative URL ({url})',
|
||||
/** [ICU Syntax] Explanatory message stating that there was a failure in an audit caused by a URL pointing to a different hreflang than the current context. "url" will be replaced by the invalid URL (e.g. https://example.com). 'hreflang' is an HTML attribute and should not be translated. */
|
||||
explanationPointsElsewhere: 'Points to another `hreflang` location ({url})',
|
||||
/** [ICU Syntax] Explanatory message stating that there was a failure in an audit caused by a URL pointing to a different domain. "url" will be replaced by the invalid URL (e.g. https://example.com). */
|
||||
explanationDifferentDomain: 'Points to a different domain ({url})',
|
||||
/** Explanatory message stating that the page's canonical URL was pointing to the domain's root URL, which is a common mistake. "points" refers to the action of the 'rel=canonical' referencing another link. "root" refers to the starting/home page of the website. "domain" refers to the registered domain name of the website. */
|
||||
explanationRoot: 'Points to the domain\'s root URL (the homepage), ' +
|
||||
'instead of an equivalent page of content',
|
||||
};
|
||||
|
||||
const str_ = i18n.createMessageInstanceIdFn(__filename, UIStrings);
|
||||
|
||||
/**
|
||||
* @param {string} headerValue
|
||||
|
@ -62,10 +88,9 @@ class Canonical extends Audit {
|
|||
static get meta() {
|
||||
return {
|
||||
id: 'canonical',
|
||||
title: 'Document has a valid `rel=canonical`',
|
||||
failureTitle: 'Document does not have a valid `rel=canonical`',
|
||||
description: 'Canonical links suggest which URL to show in search results. ' +
|
||||
'[Learn more](https://developers.google.com/web/tools/lighthouse/audits/canonical).',
|
||||
title: str_(UIStrings.title),
|
||||
failureTitle: str_(UIStrings.failureTitle),
|
||||
description: str_(UIStrings.description),
|
||||
requiredArtifacts: ['Canonical', 'Hreflang', 'URL'],
|
||||
};
|
||||
}
|
||||
|
@ -118,7 +143,7 @@ class Canonical extends Audit {
|
|||
if (canonicals.length > 1) {
|
||||
return {
|
||||
rawValue: false,
|
||||
explanation: `Multiple conflicting URLs (${canonicals.join(', ')})`,
|
||||
explanation: str_(UIStrings.explanationConflict, {urlList: canonicals.join(', ')}),
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -127,14 +152,14 @@ class Canonical extends Audit {
|
|||
if (!isValidRelativeOrAbsoluteURL(canonical)) {
|
||||
return {
|
||||
rawValue: false,
|
||||
explanation: `Invalid URL (${canonical})`,
|
||||
explanation: str_(UIStrings.explanationInvalid, {url: canonical}),
|
||||
};
|
||||
}
|
||||
|
||||
if (!URL.isValid(canonical)) {
|
||||
return {
|
||||
rawValue: false,
|
||||
explanation: `Relative URL (${canonical})`,
|
||||
explanation: str_(UIStrings.explanationRelative, {url: canonical}),
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -145,7 +170,7 @@ class Canonical extends Audit {
|
|||
baseURL.href !== canonicalURL.href) {
|
||||
return {
|
||||
rawValue: false,
|
||||
explanation: `Points to another hreflang location (${baseURL.href})`,
|
||||
explanation: str_(UIStrings.explanationPointsElsewhere, {url: baseURL.href}),
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -154,7 +179,7 @@ class Canonical extends Audit {
|
|||
if (getPrimaryDomain(canonicalURL) !== getPrimaryDomain(baseURL)) {
|
||||
return {
|
||||
rawValue: false,
|
||||
explanation: `Points to a different domain (${canonicalURL})`,
|
||||
explanation: str_(UIStrings.explanationDifferentDomain, {url: canonicalURL}),
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -163,7 +188,7 @@ class Canonical extends Audit {
|
|||
canonicalURL.pathname === '/' && baseURL.pathname !== '/') {
|
||||
return {
|
||||
rawValue: false,
|
||||
explanation: 'Points to a root of the same origin',
|
||||
explanation: str_(UIStrings.explanationRoot),
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -175,3 +200,4 @@ class Canonical extends Audit {
|
|||
}
|
||||
|
||||
module.exports = Canonical;
|
||||
module.exports.UIStrings = UIStrings;
|
||||
|
|
|
@ -14,14 +14,22 @@ const ViewportAudit = require('../viewport');
|
|||
const MINIMAL_PERCENTAGE_OF_LEGIBLE_TEXT = 60;
|
||||
|
||||
const UIStrings = {
|
||||
/** Imperative title of a Lighthouse audit that tells the user that they should use font sizes that are easily read by the user. This is displayed in a list of audit titles that Lighthouse generates. */
|
||||
/** Title of a Lighthouse audit that provides detail on the font sizes used on the page. This descriptive title is shown to users when the fonts used on the page are large enough to be considered legible. */
|
||||
title: 'Document uses legible font sizes',
|
||||
/** Imperative title of a Lighthouse audit that tells the user that they should use font sizes that are easily read by the user. This imperative title is shown to users when there is a font that is too small to be read by the user. */
|
||||
/** Title of a Lighthouse audit that provides detail on the font sizes used on the page. This descriptive title is shown to users when there is a font that may be too small to be read by users. */
|
||||
failureTitle: 'Document doesn\'t use legible font sizes',
|
||||
/** Description of a Lighthouse audit that tells the user *why* they need to use a larger font size. This is displayed after a user expands the section to see more. No character length limits. 'Learn More' becomes link text to additional documentation. */
|
||||
description: 'Font sizes less than 12px are too small to be legible and require mobile visitors to “pinch to zoom” in order to read. Strive to have >60% of page text ≥12px. [Learn more](https://developers.google.com/web/tools/lighthouse/audits/font-sizes).',
|
||||
/** [ICU Syntax] Label for the audit identifying font sizes that are too small. */
|
||||
displayValue: '{decimalProportion, number, extendedPercent} legible text',
|
||||
/** Explanatory message stating that there was a failure in an audit caused by a missing page viewport meta tag configuration. "viewport" and "meta" are HTML terms and should not be translated. */
|
||||
explanationViewport: 'Text is illegible because there\'s no viewport meta tag optimized ' +
|
||||
'for mobile screens.',
|
||||
/** Explanatory message stating that there was a failure in an audit caused by a certain percentage of the text on the page being too small. "decimalProportion" will be replaced by a percentage between 0 and 100%. */
|
||||
explanation: '{decimalProportion, number, extendedPercent} of text is too small.',
|
||||
/** Explanatory message stating that there was a failure in an audit caused by a certain percentage of the text on the page being too small, based on a sample size of text that was less than 100% of the text on the page. "decimalProportion" will be replaced by a percentage between 0 and 100%. */
|
||||
explanationWithDisclaimer: '{decimalProportion, number, extendedPercent} of text is too ' +
|
||||
'small (based on {decimalProportionVisited, number, extendedPercent} sample).',
|
||||
};
|
||||
|
||||
const str_ = i18n.createMessageInstanceIdFn(__filename, UIStrings);
|
||||
|
@ -212,8 +220,7 @@ class FontSize extends Audit {
|
|||
if (!hasViewportSet) {
|
||||
return {
|
||||
rawValue: false,
|
||||
explanation:
|
||||
'Text is illegible because there\'s no viewport meta tag optimized for mobile screens',
|
||||
explanation: str_(UIStrings.explanationViewport),
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -287,16 +294,20 @@ class FontSize extends Audit {
|
|||
|
||||
let explanation;
|
||||
if (!passed) {
|
||||
const percentageOfFailingText = parseFloat((100 - percentageOfPassingText).toFixed(2));
|
||||
let disclaimer = '';
|
||||
const percentageOfFailingText = (100 - percentageOfPassingText) / 100;
|
||||
|
||||
// if we were unable to visit all text nodes we should disclose that information
|
||||
if (visitedTextLength < totalTextLength) {
|
||||
const percentageOfVisitedText = visitedTextLength / totalTextLength * 100;
|
||||
disclaimer = ` (based on ${percentageOfVisitedText.toFixed()}% sample)`;
|
||||
const percentageOfVisitedText = (visitedTextLength / totalTextLength);
|
||||
explanation = str_(UIStrings.explanationWithDisclaimer,
|
||||
{
|
||||
decimalProportion: percentageOfFailingText,
|
||||
decimalProportionVisited: percentageOfVisitedText,
|
||||
});
|
||||
} else {
|
||||
explanation = str_(UIStrings.explanation,
|
||||
{decimalProportion: percentageOfFailingText});
|
||||
}
|
||||
|
||||
explanation = `${percentageOfFailingText}% of text is too small${disclaimer}.`;
|
||||
}
|
||||
|
||||
return {
|
||||
|
|
|
@ -11,6 +11,20 @@ const MainResource = require('../../computed/main-resource.js');
|
|||
const VALID_LANGS = importValidLangs();
|
||||
const LINK_HEADER = 'link';
|
||||
const NO_LANGUAGE = 'x-default';
|
||||
const i18n = require('../../lib/i18n/i18n.js');
|
||||
|
||||
const UIStrings = {
|
||||
/** Title of a Lighthouse audit that provides detail on the `hreflang` attribute on a page. This descriptive title is shown when the page's `hreflang` attribute is configured correctly. "hreflang" is an HTML attribute and should not be translated. */
|
||||
title: 'Document has a valid `hreflang`',
|
||||
/** Title of a Lighthouse audit that provides detail on the `hreflang` attribute on a page. This descriptive title is shown when the page's `hreflang` attribute is not valid and needs to be fixed. "hreflang" is an HTML attribute and should not be translated. */
|
||||
failureTitle: 'Document doesn\'t have a valid `hreflang`',
|
||||
/** Description of a Lighthouse audit that tells the user *why* they need to have an hreflang link on their page. This is displayed after a user expands the section to see more. No character length limits. 'Learn More' becomes link text to additional documentation. "hreflang" is an HTML attribute and should not be translated. */
|
||||
description: 'hreflang links tell search engines what version of a page they should ' +
|
||||
'list in search results for a given language or region. [Learn more]' +
|
||||
'(https://developers.google.com/web/tools/lighthouse/audits/hreflang).',
|
||||
};
|
||||
|
||||
const str_ = i18n.createMessageInstanceIdFn(__filename, UIStrings);
|
||||
|
||||
/**
|
||||
* Import list of valid languages from axe core without including whole axe-core package
|
||||
|
@ -65,11 +79,9 @@ class Hreflang extends Audit {
|
|||
static get meta() {
|
||||
return {
|
||||
id: 'hreflang',
|
||||
title: 'Document has a valid `hreflang`',
|
||||
failureTitle: 'Document doesn\'t have a valid `hreflang`',
|
||||
description: 'hreflang links tell search engines what version of a page they should ' +
|
||||
'list in search results for a given language or region. [Learn more]' +
|
||||
'(https://developers.google.com/web/tools/lighthouse/audits/hreflang).',
|
||||
title: str_(UIStrings.title),
|
||||
failureTitle: str_(UIStrings.failureTitle),
|
||||
description: str_(UIStrings.description),
|
||||
requiredArtifacts: ['Hreflang', 'URL'],
|
||||
};
|
||||
}
|
||||
|
@ -120,3 +132,4 @@ class Hreflang extends Audit {
|
|||
}
|
||||
|
||||
module.exports = Hreflang;
|
||||
module.exports.UIStrings = UIStrings;
|
||||
|
|
|
@ -9,6 +9,20 @@ const Audit = require('../audit');
|
|||
const MainResource = require('../../computed/main-resource.js');
|
||||
const HTTP_UNSUCCESSFUL_CODE_LOW = 400;
|
||||
const HTTP_UNSUCCESSFUL_CODE_HIGH = 599;
|
||||
const i18n = require('../../lib/i18n/i18n.js');
|
||||
|
||||
const UIStrings = {
|
||||
/** Title of a Lighthouse audit that provides detail on the HTTP status code a page responds with. This descriptive title is shown when the page has responded with a valid HTTP status code. */
|
||||
title: 'Page has successful HTTP status code',
|
||||
/** Descriptive title of a Lighthouse audit that provides detail on the HTTP status code a page responds with. This descriptive title is shown when the page responds to requests with an HTTP status code that indicates the request was unsuccessful. */
|
||||
failureTitle: 'Page has unsuccessful HTTP status code',
|
||||
/** Description of a Lighthouse audit that tells the user *why* they need to serve pages with a valid HTTP status code. This is displayed after a user expands the section to see more. No character length limits. 'Learn More' becomes link text to additional documentation. */
|
||||
description: 'Pages with unsuccessful HTTP status codes may not be indexed properly. ' +
|
||||
'[Learn more]' +
|
||||
'(https://developers.google.com/web/tools/lighthouse/audits/successful-http-code).',
|
||||
};
|
||||
|
||||
const str_ = i18n.createMessageInstanceIdFn(__filename, UIStrings);
|
||||
|
||||
class HTTPStatusCode extends Audit {
|
||||
/**
|
||||
|
@ -17,11 +31,9 @@ class HTTPStatusCode extends Audit {
|
|||
static get meta() {
|
||||
return {
|
||||
id: 'http-status-code',
|
||||
title: 'Page has successful HTTP status code',
|
||||
failureTitle: 'Page has unsuccessful HTTP status code',
|
||||
description: 'Pages with unsuccessful HTTP status codes may not be indexed properly. ' +
|
||||
'[Learn more]' +
|
||||
'(https://developers.google.com/web/tools/lighthouse/audits/successful-http-code).',
|
||||
title: str_(UIStrings.title),
|
||||
failureTitle: str_(UIStrings.failureTitle),
|
||||
description: str_(UIStrings.description),
|
||||
requiredArtifacts: ['devtoolsLogs', 'URL'],
|
||||
};
|
||||
}
|
||||
|
@ -55,3 +67,4 @@ class HTTPStatusCode extends Audit {
|
|||
}
|
||||
|
||||
module.exports = HTTPStatusCode;
|
||||
module.exports.UIStrings = UIStrings;
|
||||
|
|
|
@ -15,6 +15,20 @@ const BLOCKLIST = new Set([
|
|||
]);
|
||||
const ROBOTS_HEADER = 'x-robots-tag';
|
||||
const UNAVAILABLE_AFTER = 'unavailable_after';
|
||||
const i18n = require('../../lib/i18n/i18n.js');
|
||||
|
||||
const UIStrings = {
|
||||
/** Title of a Lighthouse audit that provides detail on if search-engine crawlers are blocked from indexing the page. This title is shown when the page is not blocked from indexing and can be crawled. */
|
||||
title: 'Page isn’t blocked from indexing',
|
||||
/** Title of a Lighthouse audit that provides detail on if search-engine crawlers are blocked from indexing the page. This title is shown when the page has been configured to block indexing and therefore cannot be indexed by search engines. */
|
||||
failureTitle: 'Page is blocked from indexing',
|
||||
/** Description of a Lighthouse audit that tells the user *why* allowing search-engine crawling of their page is beneficial. This is displayed after a user expands the section to see more. No character length limits. 'Learn More' becomes link text to additional documentation. */
|
||||
description: 'Search engines are unable to include your pages in search results ' +
|
||||
'if they don\'t have permission to crawl them. [Learn ' +
|
||||
'more](https://developers.google.com/web/tools/lighthouse/audits/indexing).',
|
||||
};
|
||||
|
||||
const str_ = i18n.createMessageInstanceIdFn(__filename, UIStrings);
|
||||
|
||||
/**
|
||||
* Checks if given directive is a valid unavailable_after directive with a date in the past
|
||||
|
@ -64,11 +78,9 @@ class IsCrawlable extends Audit {
|
|||
static get meta() {
|
||||
return {
|
||||
id: 'is-crawlable',
|
||||
title: 'Page isn’t blocked from indexing',
|
||||
failureTitle: 'Page is blocked from indexing',
|
||||
description: 'Search engines are unable to include your pages in search results ' +
|
||||
'if they don\'t have permission to crawl them. [Learn ' +
|
||||
'more](https://developers.google.com/web/tools/lighthouse/audits/indexing).',
|
||||
title: str_(UIStrings.title),
|
||||
failureTitle: str_(UIStrings.failureTitle),
|
||||
description: str_(UIStrings.description),
|
||||
requiredArtifacts: ['MetaElements', 'RobotsTxt', 'URL'],
|
||||
};
|
||||
}
|
||||
|
@ -135,3 +147,4 @@ class IsCrawlable extends Audit {
|
|||
}
|
||||
|
||||
module.exports = IsCrawlable;
|
||||
module.exports.UIStrings = UIStrings;
|
||||
|
|
|
@ -18,6 +18,24 @@ const BLOCKLIST = new Set([
|
|||
'more',
|
||||
'learn more',
|
||||
]);
|
||||
const i18n = require('../../lib/i18n/i18n.js');
|
||||
|
||||
const UIStrings = {
|
||||
/** Title of a Lighthouse audit that tests if each link on a page contains a sufficient description of what a user will find when they click it. Generic, non-descriptive text like "click here" doesn't give an indication of what the link leads to. This descriptive title is shown when all links on the page have sufficient textual descriptions. */
|
||||
title: 'Links have descriptive text',
|
||||
/** Title of a Lighthouse audit that tests if each link on a page contains a sufficient description of what a user will find when they click it. Generic, non-descriptive text like "click here" doesn't give an indication of what the link leads to. This descriptive title is shown when one or more links on the page contain generic, non-descriptive text. */
|
||||
failureTitle: 'Links do not have descriptive text',
|
||||
/** Description of a Lighthouse audit that tells the user *why* they need to have descriptive text on the links in their page. This is displayed after a user expands the section to see more. No character length limits. 'Learn More' becomes link text to additional documentation. */
|
||||
description: 'Descriptive link text helps search engines understand your content. ' +
|
||||
'[Learn more](https://developers.google.com/web/tools/lighthouse/audits/descriptive-link-text).',
|
||||
/** [ICU Syntax] Label for the audit identifying the number of links found. "link" here refers to the links in a web page to other web pages. */
|
||||
displayValue: `{itemCount, plural,
|
||||
=1 {1 link found}
|
||||
other {# links found}
|
||||
}`,
|
||||
};
|
||||
|
||||
const str_ = i18n.createMessageInstanceIdFn(__filename, UIStrings);
|
||||
|
||||
class LinkText extends Audit {
|
||||
/**
|
||||
|
@ -26,10 +44,9 @@ class LinkText extends Audit {
|
|||
static get meta() {
|
||||
return {
|
||||
id: 'link-text',
|
||||
title: 'Links have descriptive text',
|
||||
failureTitle: 'Links do not have descriptive text',
|
||||
description: 'Descriptive link text helps search engines understand your content. ' +
|
||||
'[Learn more](https://developers.google.com/web/tools/lighthouse/audits/descriptive-link-text).',
|
||||
title: str_(UIStrings.title),
|
||||
failureTitle: str_(UIStrings.failureTitle),
|
||||
description: str_(UIStrings.description),
|
||||
requiredArtifacts: ['URL', 'AnchorElements'],
|
||||
};
|
||||
}
|
||||
|
@ -70,8 +87,7 @@ class LinkText extends Audit {
|
|||
let displayValue;
|
||||
|
||||
if (failingLinks.length) {
|
||||
displayValue = failingLinks.length > 1 ?
|
||||
`${failingLinks.length} links found` : '1 link found';
|
||||
displayValue = str_(UIStrings.displayValue, {itemCount: failingLinks.length});
|
||||
}
|
||||
|
||||
return {
|
||||
|
@ -83,3 +99,4 @@ class LinkText extends Audit {
|
|||
}
|
||||
|
||||
module.exports = LinkText;
|
||||
module.exports.UIStrings = UIStrings;
|
||||
|
|
|
@ -6,6 +6,16 @@
|
|||
'use strict';
|
||||
|
||||
const ManualAudit = require('../../manual/manual-audit');
|
||||
const i18n = require('../../../lib/i18n/i18n.js');
|
||||
|
||||
const UIStrings = {
|
||||
/** Description of a Lighthouse audit that provides detail on the structured data in a page. "Structured data" is a standardized data format on a page that helps a search engine categorize and understand its contents. This description is displayed after a user expands the section to see more. No character length limits. 'Learn More' becomes link text to additional documentation. */
|
||||
description: 'Run the [Structured Data Testing Tool](https://search.google.com/structured-data/testing-tool/) and the [Structured Data Linter](http://linter.structured-data.org/) to validate structured data. [Learn more](https://developers.google.com/search/docs/guides/mark-up-content).',
|
||||
/** Title of a Lighthouse audit that prompts users to manually check their page for valid structured data. "Structured data" is a standardized data format on a page that helps a search engine categorize and understand its contents. */
|
||||
title: 'Structured data is valid',
|
||||
};
|
||||
|
||||
const str_ = i18n.createMessageInstanceIdFn(__filename, UIStrings);
|
||||
|
||||
/**
|
||||
* @fileoverview Manual SEO audit to check if structured data on page is valid.
|
||||
|
@ -18,10 +28,11 @@ class StructuredData extends ManualAudit {
|
|||
static get meta() {
|
||||
return Object.assign({
|
||||
id: 'structured-data',
|
||||
description: 'Run the [Structured Data Testing Tool](https://search.google.com/structured-data/testing-tool/) and the [Structured Data Linter](http://linter.structured-data.org/) to validate structured data. [Learn more](https://developers.google.com/search/docs/guides/mark-up-content).',
|
||||
title: 'Structured data is valid',
|
||||
description: str_(UIStrings.description),
|
||||
title: str_(UIStrings.title),
|
||||
}, super.partialMeta);
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = StructuredData;
|
||||
module.exports.UIStrings = UIStrings;
|
||||
|
|
|
@ -6,6 +6,22 @@
|
|||
'use strict';
|
||||
|
||||
const Audit = require('../audit');
|
||||
const i18n = require('../../lib/i18n/i18n.js');
|
||||
|
||||
const UIStrings = {
|
||||
/** Title of a Lighthouse audit that provides detail on the web page's document meta description. This descriptive title is shown when the document has a meta description. "meta" should be left untranslated because it refers to an HTML element. */
|
||||
title: 'Document has a meta description',
|
||||
/** Title of a Lighthouse audit that provides detail on the web page's document meta description. This descriptive title is shown when the document does not have a meta description. "meta" should be left untranslated because it refers to an HTML element. */
|
||||
failureTitle: 'Document does not have a meta description',
|
||||
/** Description of a Lighthouse audit that tells the user *why* they need to have meta descriptions on their page. This is displayed after a user expands the section to see more. No character length limits. 'Learn More' becomes link text to additional documentation. */
|
||||
description: 'Meta descriptions may be included in search results to concisely summarize ' +
|
||||
'page content. ' +
|
||||
'[Learn more](https://developers.google.com/web/tools/lighthouse/audits/description).',
|
||||
/** Explanatory message stating that there was a failure in an audit caused by the page's meta description text being empty. */
|
||||
explanation: 'Description text is empty.',
|
||||
};
|
||||
|
||||
const str_ = i18n.createMessageInstanceIdFn(__filename, UIStrings);
|
||||
|
||||
class Description extends Audit {
|
||||
/**
|
||||
|
@ -14,11 +30,9 @@ class Description extends Audit {
|
|||
static get meta() {
|
||||
return {
|
||||
id: 'meta-description',
|
||||
title: 'Document has a meta description',
|
||||
failureTitle: 'Document does not have a meta description',
|
||||
description: 'Meta descriptions may be included in search results to concisely summarize ' +
|
||||
'page content. ' +
|
||||
'[Learn more](https://developers.google.com/web/tools/lighthouse/audits/description).',
|
||||
title: str_(UIStrings.title),
|
||||
failureTitle: str_(UIStrings.failureTitle),
|
||||
description: str_(UIStrings.description),
|
||||
requiredArtifacts: ['MetaElements'],
|
||||
};
|
||||
}
|
||||
|
@ -39,7 +53,7 @@ class Description extends Audit {
|
|||
if (description.trim().length === 0) {
|
||||
return {
|
||||
rawValue: false,
|
||||
explanation: 'Description text is empty.',
|
||||
explanation: str_(UIStrings.explanation),
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -50,3 +64,4 @@ class Description extends Audit {
|
|||
}
|
||||
|
||||
module.exports = Description;
|
||||
module.exports.UIStrings = UIStrings;
|
||||
|
|
|
@ -31,6 +31,20 @@ const SOURCE_PARAMS = new Set([
|
|||
'source',
|
||||
'src',
|
||||
]);
|
||||
const i18n = require('../../lib/i18n/i18n.js');
|
||||
|
||||
const UIStrings = {
|
||||
/** Title of a Lighthouse audit that provides detail on the browser plugins used by the page. This descriptive title is shown when there is no plugin content on the page that would restrict search indexing. */
|
||||
title: 'Document avoids plugins',
|
||||
/** Descriptive title of a Lighthouse audit that provides detail on the browser plugins used by the page. This title is shown when there is plugin content on the page. */
|
||||
failureTitle: 'Document uses plugins',
|
||||
/** Description of a Lighthouse audit that tells the user *why* they need to avoid using browser plugins in their content. This is displayed after a user expands the section to see more. No character length limits. 'Learn More' becomes link text to additional documentation. */
|
||||
description: 'Search engines can\'t index plugin content, and ' +
|
||||
'many devices restrict plugins or don\'t support them. ' +
|
||||
'[Learn more](https://developers.google.com/web/tools/lighthouse/audits/plugins).',
|
||||
};
|
||||
|
||||
const str_ = i18n.createMessageInstanceIdFn(__filename, UIStrings);
|
||||
|
||||
/**
|
||||
* Verifies if given MIME type matches any known plugin MIME type
|
||||
|
@ -73,11 +87,9 @@ class Plugins extends Audit {
|
|||
static get meta() {
|
||||
return {
|
||||
id: 'plugins',
|
||||
title: 'Document avoids plugins',
|
||||
failureTitle: 'Document uses plugins',
|
||||
description: 'Search engines can\'t index plugin content, and ' +
|
||||
'many devices restrict plugins or don\'t support them. ' +
|
||||
'[Learn more](https://developers.google.com/web/tools/lighthouse/audits/plugins).',
|
||||
title: str_(UIStrings.title),
|
||||
failureTitle: str_(UIStrings.failureTitle),
|
||||
description: str_(UIStrings.description),
|
||||
requiredArtifacts: ['EmbeddedContent'],
|
||||
};
|
||||
}
|
||||
|
@ -155,3 +167,4 @@ class Plugins extends Audit {
|
|||
}
|
||||
|
||||
module.exports = Plugins;
|
||||
module.exports.UIStrings = UIStrings;
|
||||
|
|
|
@ -31,6 +31,28 @@ const DIRECTIVE_SAFELIST = new Set([
|
|||
'request-rate', 'visit-time', 'noindex', // not officially supported, but used in the wild
|
||||
]);
|
||||
const SITEMAP_VALID_PROTOCOLS = new Set(['https:', 'http:', 'ftp:']);
|
||||
const i18n = require('../../lib/i18n/i18n.js');
|
||||
|
||||
const UIStrings = {
|
||||
/** Title of a Lighthouse audit that provides detail on the site's robots.txt file. Note: "robots.txt" is a canonical filename and should not be translated. This descriptive title is shown when the robots.txt file is present and configured correctly. */
|
||||
title: 'robots.txt is valid',
|
||||
/** Title of a Lighthouse audit that provides detail on the site's robots.txt file. Note: "robots.txt" is a canonical filename and should not be translated. This descriptive title is shown when the robots.txt file is misconfigured, which makes the page hard or impossible to scan via web crawler. */
|
||||
failureTitle: 'robots.txt is not valid',
|
||||
/** Description of a Lighthouse audit that tells the user *why* they need to have a valid robots.txt file. Note: "robots.txt" is a canonical filename and should not be translated. This is displayed after a user expands the section to see more. No character length limits. */
|
||||
description: 'If your robots.txt file is malformed, crawlers may not be able to understand ' +
|
||||
'how you want your website to be crawled or indexed.',
|
||||
/** [ICU Syntax] Label for the audit identifying that the robots.txt request has returned a specific HTTP status code. Note: "robots.txt" is a canonical filename and should not be translated. "statusCode" will be replaced with a 3 digit integer which represents the status of the HTTP connectiong for this page. */
|
||||
displayValueHttpBadCode: 'request for robots.txt returned HTTP status: {statusCode, number}',
|
||||
/** [ICU Syntax] Label for the audit identifying the number of errors that occured while validating the robots.txt file. "itemCount" will be replaced by the integer count of errors encountered. */
|
||||
displayValueValidationError: `{itemCount, plural,
|
||||
=1 {1 error found}
|
||||
other {# errors found}
|
||||
}`,
|
||||
/** Explanatory message stating that there was a failure in an audit caused by Lighthouse not being able to download the robots.txt file for the site. Note: "robots.txt" is a canonical filename and should not be translated. */
|
||||
explanation: 'Lighthouse was unable to download a robots.txt file',
|
||||
};
|
||||
|
||||
const str_ = i18n.createMessageInstanceIdFn(__filename, UIStrings);
|
||||
|
||||
/**
|
||||
* @param {string} directiveName
|
||||
|
@ -161,10 +183,9 @@ class RobotsTxt extends Audit {
|
|||
static get meta() {
|
||||
return {
|
||||
id: 'robots-txt',
|
||||
title: 'robots.txt is valid',
|
||||
failureTitle: 'robots.txt is not valid',
|
||||
description: 'If your robots.txt file is malformed, crawlers may not be able to understand ' +
|
||||
'how you want your website to be crawled or indexed.',
|
||||
title: str_(UIStrings.title),
|
||||
failureTitle: str_(UIStrings.failureTitle),
|
||||
description: str_(UIStrings.description),
|
||||
requiredArtifacts: ['RobotsTxt'],
|
||||
};
|
||||
}
|
||||
|
@ -182,14 +203,14 @@ class RobotsTxt extends Audit {
|
|||
if (!status) {
|
||||
return {
|
||||
rawValue: false,
|
||||
explanation: 'Lighthouse was unable to download your robots.txt file',
|
||||
explanation: str_(UIStrings.explanation),
|
||||
};
|
||||
}
|
||||
|
||||
if (status >= HTTP_SERVER_ERROR_CODE_LOW) {
|
||||
return {
|
||||
rawValue: false,
|
||||
displayValue: `request for robots.txt returned HTTP${status}`,
|
||||
displayValue: str_(UIStrings.displayValueHttpBadCode, {statusCode: status}),
|
||||
};
|
||||
} else if (status >= HTTP_CLIENT_ERROR_CODE_LOW || content === '') {
|
||||
return {
|
||||
|
@ -216,8 +237,8 @@ class RobotsTxt extends Audit {
|
|||
let displayValue;
|
||||
|
||||
if (validationErrors.length) {
|
||||
displayValue = validationErrors.length > 1 ?
|
||||
`${validationErrors.length} errors found` : '1 error found';
|
||||
displayValue =
|
||||
str_(UIStrings.displayValueValidationError, {itemCount: validationErrors.length});
|
||||
}
|
||||
|
||||
return {
|
||||
|
@ -229,3 +250,4 @@ class RobotsTxt extends Audit {
|
|||
}
|
||||
|
||||
module.exports = RobotsTxt;
|
||||
module.exports.UIStrings = UIStrings;
|
||||
|
|
|
@ -25,7 +25,7 @@ const i18n = require('../../lib/i18n/i18n.js');
|
|||
const UIStrings = {
|
||||
/** Title of a Lighthouse audit that provides detail on whether tap targets (like buttons and links) on a page are big enough so they can easily be tapped on a mobile device. This descriptive title is shown when tap targets are easy to tap on. */
|
||||
title: 'Tap targets are sized appropriately',
|
||||
/** Title of a Lighthouse audit that provides detail on whether tap targets (like buttons and links) on a page are big enough so they can easily be tapped on a mobile device. This descriptive title is shown when tap targets are not easy to tap on. */
|
||||
/** Descriptive title of a Lighthouse audit that provides detail on whether tap targets (like buttons and links) on a page are big enough so they can easily be tapped on a mobile device. This descriptive title is shown when tap targets are not easy to tap on. */
|
||||
failureTitle: 'Tap targets are not sized appropriately',
|
||||
/** Description of a Lighthouse audit that tells the user why buttons and links need to be big enough and what 'big enough' means. This is displayed after a user expands the section to see more. No character length limits. 'Learn More' becomes link text to additional documentation. */
|
||||
description: 'Interactive elements like buttons and links should be large enough (48x48px), and have enough space around them, to be easy enough to tap without overlapping onto other elements. [Learn more](https://developers.google.com/web/fundamentals/accessibility/accessible-styles#multi-device_responsive_design).',
|
||||
|
|
|
@ -69,6 +69,14 @@ const UIStrings = {
|
|||
a11yMetaGroupTitle: 'Meta Tags Used Properly',
|
||||
/* Description of the meta tag section within the Accessibility category. Within this section are audits with descriptive titles that highlight if meta tags on the page have been used properly and if any important ones are missing. */
|
||||
a11yMetaGroupDescription: 'These are opportunities to improve the user experience of your site.',
|
||||
/** Title of the Search Engine Optimization (SEO) category of audits. This is displayed at the top of a list of audits focused on topics related to optimizing a website for indexing by search engines. Also used as a label of a score gauge; try to limit to 20 characters. */
|
||||
seoCategoryTitle: 'SEO',
|
||||
/** Description of the Search Engine Optimization (SEO) category. This is displayed at the top of a list of audits focused on optimizing a website for indexing by search engines. No character length limits. 'Learn More' becomes link text to additional documentation. */
|
||||
seoCategoryDescription: 'These checks ensure that your page is optimized for search engine results ranking. ' +
|
||||
'There are additional factors Lighthouse does not check that may affect your search ranking. ' +
|
||||
'[Learn more](https://support.google.com/webmasters/answer/35769).',
|
||||
/** Description of the Search Engine Optimization (SEO) manual checks category, the additional validators must be run by hand in order to check all SEO best practices. This is displayed at the top of a list of manually run audits focused on optimizing a website for indexing by search engines. No character length limits. */
|
||||
seoCategoryManualDescription: 'Run these additional validators on your site to check additional SEO best practices.',
|
||||
/** Title of the Fast and Reliable section of the web app category. Within this section are audits that check if the web site loaded quickly and can reliably load even if the internet connection is very slow or goes offline. */
|
||||
pwaFastReliableGroupTitle: 'Fast and reliable',
|
||||
/** Title of the Installable section of the web app category. Within this section are audits that check if Chrome supports installing the web site as an app on their device. */
|
||||
|
@ -446,11 +454,9 @@ const defaultConfig = {
|
|||
],
|
||||
},
|
||||
'seo': {
|
||||
title: 'SEO',
|
||||
description: 'These checks ensure that your page is optimized for search engine results ranking. ' +
|
||||
'There are additional factors Lighthouse does not check that may affect your search ranking. ' +
|
||||
'[Learn more](https://support.google.com/webmasters/answer/35769).',
|
||||
manualDescription: 'Run these additional validators on your site to check additional SEO best practices.',
|
||||
title: str_(UIStrings.seoCategoryTitle),
|
||||
description: str_(UIStrings.seoCategoryDescription),
|
||||
manualDescription: str_(UIStrings.seoCategoryManualDescription),
|
||||
auditRefs: [
|
||||
{id: 'viewport', weight: 1, group: 'seo-mobile'},
|
||||
{id: 'document-title', weight: 1, group: 'seo-content'},
|
||||
|
|
|
@ -747,6 +747,42 @@
|
|||
"message": "Avoid multiple page redirects",
|
||||
"description": "Imperative title of a Lighthouse audit that tells the user to eliminate the redirects taken through multiple URLs to load the page. This is shown in a list of audits that Lighthouse generates."
|
||||
},
|
||||
"lighthouse-core/audits/seo/canonical.js | description": {
|
||||
"message": "Canonical links suggest which URL to show in search results. [Learn more](https://developers.google.com/web/tools/lighthouse/audits/canonical).",
|
||||
"description": "Description of a Lighthouse audit that tells the user *why* they need to have a valid rel=canonical link. This is displayed after a user expands the section to see more. No character length limits. 'Learn More' becomes link text to additional documentation."
|
||||
},
|
||||
"lighthouse-core/audits/seo/canonical.js | explanationConflict": {
|
||||
"message": "Multiple conflicting URLs ({urlList})",
|
||||
"description": "[ICU Syntax] Explanatory message stating that there was a failure in an audit caused by multiple URLs conflicting with each other. \"urlList\" will be replaced by a list of URLs (e.g. https://example.com, https://example2.com, etc )."
|
||||
},
|
||||
"lighthouse-core/audits/seo/canonical.js | explanationDifferentDomain": {
|
||||
"message": "Points to a different domain ({url})",
|
||||
"description": "[ICU Syntax] Explanatory message stating that there was a failure in an audit caused by a URL pointing to a different domain. \"url\" will be replaced by the invalid URL (e.g. https://example.com)."
|
||||
},
|
||||
"lighthouse-core/audits/seo/canonical.js | explanationInvalid": {
|
||||
"message": "Invalid URL ({url})",
|
||||
"description": "[ICU Syntax] Explanatory message stating that there was a failure in an audit caused by a URL being invalid. \"url\" will be replaced by the invalid URL (e.g. https://example.com)."
|
||||
},
|
||||
"lighthouse-core/audits/seo/canonical.js | explanationPointsElsewhere": {
|
||||
"message": "Points to another `hreflang` location ({url})",
|
||||
"description": "[ICU Syntax] Explanatory message stating that there was a failure in an audit caused by a URL pointing to a different hreflang than the current context. \"url\" will be replaced by the invalid URL (e.g. https://example.com). 'hreflang' is an HTML attribute and should not be translated."
|
||||
},
|
||||
"lighthouse-core/audits/seo/canonical.js | explanationRelative": {
|
||||
"message": "Relative URL ({url})",
|
||||
"description": "[ICU Syntax] Explanatory message stating that there was a failure in an audit caused by a URL being relative instead of absolute. \"url\" will be replaced by the invalid URL (e.g. https://example.com)."
|
||||
},
|
||||
"lighthouse-core/audits/seo/canonical.js | explanationRoot": {
|
||||
"message": "Points to the domain's root URL (the homepage), instead of an equivalent page of content",
|
||||
"description": "Explanatory message stating that the page's canonical URL was pointing to the domain's root URL, which is a common mistake. \"points\" refers to the action of the 'rel=canonical' referencing another link. \"root\" refers to the starting/home page of the website. \"domain\" refers to the registered domain name of the website."
|
||||
},
|
||||
"lighthouse-core/audits/seo/canonical.js | failureTitle": {
|
||||
"message": "Document does not have a valid `rel=canonical`",
|
||||
"description": "Title of a Lighthouse audit that provides detail on a page's rel=canonical link. This descriptive title is shown to users when the rel=canonical link is invalid and should be fixed. \"rel=canonical\" is an HTML attribute and value and so should not be translated."
|
||||
},
|
||||
"lighthouse-core/audits/seo/canonical.js | title": {
|
||||
"message": "Document has a valid `rel=canonical`",
|
||||
"description": "Title of a Lighthouse audit that provides detail on a page's rel=canonical link. This descriptive title is shown to users when the rel=canonical link is valid. \"rel=canonical\" is an HTML attribute and value and so should not be translated."
|
||||
},
|
||||
"lighthouse-core/audits/seo/font-size.js | description": {
|
||||
"message": "Font sizes less than 12px are too small to be legible and require mobile visitors to “pinch to zoom” in order to read. Strive to have >60% of page text ≥12px. [Learn more](https://developers.google.com/web/tools/lighthouse/audits/font-sizes).",
|
||||
"description": "Description of a Lighthouse audit that tells the user *why* they need to use a larger font size. This is displayed after a user expands the section to see more. No character length limits. 'Learn More' becomes link text to additional documentation."
|
||||
|
@ -755,13 +791,137 @@
|
|||
"message": "{decimalProportion, number, extendedPercent} legible text",
|
||||
"description": "[ICU Syntax] Label for the audit identifying font sizes that are too small."
|
||||
},
|
||||
"lighthouse-core/audits/seo/font-size.js | explanation": {
|
||||
"message": "{decimalProportion, number, extendedPercent} of text is too small.",
|
||||
"description": "Explanatory message stating that there was a failure in an audit caused by a certain percentage of the text on the page being too small. \"decimalProportion\" will be replaced by a percentage between 0 and 100%."
|
||||
},
|
||||
"lighthouse-core/audits/seo/font-size.js | explanationViewport": {
|
||||
"message": "Text is illegible because there's no viewport meta tag optimized for mobile screens.",
|
||||
"description": "Explanatory message stating that there was a failure in an audit caused by a missing page viewport meta tag configuration. \"viewport\" and \"meta\" are HTML terms and should not be translated."
|
||||
},
|
||||
"lighthouse-core/audits/seo/font-size.js | explanationWithDisclaimer": {
|
||||
"message": "{decimalProportion, number, extendedPercent} of text is too small (based on {decimalProportionVisited, number, extendedPercent} sample).",
|
||||
"description": "Explanatory message stating that there was a failure in an audit caused by a certain percentage of the text on the page being too small, based on a sample size of text that was less than 100% of the text on the page. \"decimalProportion\" will be replaced by a percentage between 0 and 100%."
|
||||
},
|
||||
"lighthouse-core/audits/seo/font-size.js | failureTitle": {
|
||||
"message": "Document doesn't use legible font sizes",
|
||||
"description": "Imperative title of a Lighthouse audit that tells the user that they should use font sizes that are easily read by the user. This imperative title is shown to users when there is a font that is too small to be read by the user."
|
||||
"description": "Title of a Lighthouse audit that provides detail on the font sizes used on the page. This descriptive title is shown to users when there is a font that may be too small to be read by users."
|
||||
},
|
||||
"lighthouse-core/audits/seo/font-size.js | title": {
|
||||
"message": "Document uses legible font sizes",
|
||||
"description": "Imperative title of a Lighthouse audit that tells the user that they should use font sizes that are easily read by the user. This is displayed in a list of audit titles that Lighthouse generates."
|
||||
"description": "Title of a Lighthouse audit that provides detail on the font sizes used on the page. This descriptive title is shown to users when the fonts used on the page are large enough to be considered legible."
|
||||
},
|
||||
"lighthouse-core/audits/seo/hreflang.js | description": {
|
||||
"message": "hreflang links tell search engines what version of a page they should list in search results for a given language or region. [Learn more](https://developers.google.com/web/tools/lighthouse/audits/hreflang).",
|
||||
"description": "Description of a Lighthouse audit that tells the user *why* they need to have an hreflang link on their page. This is displayed after a user expands the section to see more. No character length limits. 'Learn More' becomes link text to additional documentation. \"hreflang\" is an HTML attribute and should not be translated."
|
||||
},
|
||||
"lighthouse-core/audits/seo/hreflang.js | failureTitle": {
|
||||
"message": "Document doesn't have a valid `hreflang`",
|
||||
"description": "Title of a Lighthouse audit that provides detail on the `hreflang` attribute on a page. This descriptive title is shown when the page's `hreflang` attribute is not valid and needs to be fixed. \"hreflang\" is an HTML attribute and should not be translated."
|
||||
},
|
||||
"lighthouse-core/audits/seo/hreflang.js | title": {
|
||||
"message": "Document has a valid `hreflang`",
|
||||
"description": "Title of a Lighthouse audit that provides detail on the `hreflang` attribute on a page. This descriptive title is shown when the page's `hreflang` attribute is configured correctly. \"hreflang\" is an HTML attribute and should not be translated."
|
||||
},
|
||||
"lighthouse-core/audits/seo/http-status-code.js | description": {
|
||||
"message": "Pages with unsuccessful HTTP status codes may not be indexed properly. [Learn more](https://developers.google.com/web/tools/lighthouse/audits/successful-http-code).",
|
||||
"description": "Description of a Lighthouse audit that tells the user *why* they need to serve pages with a valid HTTP status code. This is displayed after a user expands the section to see more. No character length limits. 'Learn More' becomes link text to additional documentation."
|
||||
},
|
||||
"lighthouse-core/audits/seo/http-status-code.js | failureTitle": {
|
||||
"message": "Page has unsuccessful HTTP status code",
|
||||
"description": "Descriptive title of a Lighthouse audit that provides detail on the HTTP status code a page responds with. This descriptive title is shown when the page responds to requests with an HTTP status code that indicates the request was unsuccessful."
|
||||
},
|
||||
"lighthouse-core/audits/seo/http-status-code.js | title": {
|
||||
"message": "Page has successful HTTP status code",
|
||||
"description": "Title of a Lighthouse audit that provides detail on the HTTP status code a page responds with. This descriptive title is shown when the page has responded with a valid HTTP status code."
|
||||
},
|
||||
"lighthouse-core/audits/seo/is-crawlable.js | description": {
|
||||
"message": "Search engines are unable to include your pages in search results if they don't have permission to crawl them. [Learn more](https://developers.google.com/web/tools/lighthouse/audits/indexing).",
|
||||
"description": "Description of a Lighthouse audit that tells the user *why* allowing search-engine crawling of their page is beneficial. This is displayed after a user expands the section to see more. No character length limits. 'Learn More' becomes link text to additional documentation."
|
||||
},
|
||||
"lighthouse-core/audits/seo/is-crawlable.js | failureTitle": {
|
||||
"message": "Page is blocked from indexing",
|
||||
"description": "Title of a Lighthouse audit that provides detail on if search-engine crawlers are blocked from indexing the page. This title is shown when the page has been configured to block indexing and therefore cannot be indexed by search engines."
|
||||
},
|
||||
"lighthouse-core/audits/seo/is-crawlable.js | title": {
|
||||
"message": "Page isn’t blocked from indexing",
|
||||
"description": "Title of a Lighthouse audit that provides detail on if search-engine crawlers are blocked from indexing the page. This title is shown when the page is not blocked from indexing and can be crawled."
|
||||
},
|
||||
"lighthouse-core/audits/seo/link-text.js | description": {
|
||||
"message": "Descriptive link text helps search engines understand your content. [Learn more](https://developers.google.com/web/tools/lighthouse/audits/descriptive-link-text).",
|
||||
"description": "Description of a Lighthouse audit that tells the user *why* they need to have descriptive text on the links in their page. This is displayed after a user expands the section to see more. No character length limits. 'Learn More' becomes link text to additional documentation."
|
||||
},
|
||||
"lighthouse-core/audits/seo/link-text.js | displayValue": {
|
||||
"message": "{itemCount, plural,\n =1 {1 link found}\n other {# links found}\n }",
|
||||
"description": "[ICU Syntax] Label for the audit identifying the number of links found. \"link\" here refers to the links in a web page to other web pages."
|
||||
},
|
||||
"lighthouse-core/audits/seo/link-text.js | failureTitle": {
|
||||
"message": "Links do not have descriptive text",
|
||||
"description": "Title of a Lighthouse audit that tests if each link on a page contains a sufficient description of what a user will find when they click it. Generic, non-descriptive text like \"click here\" doesn't give an indication of what the link leads to. This descriptive title is shown when one or more links on the page contain generic, non-descriptive text."
|
||||
},
|
||||
"lighthouse-core/audits/seo/link-text.js | title": {
|
||||
"message": "Links have descriptive text",
|
||||
"description": "Title of a Lighthouse audit that tests if each link on a page contains a sufficient description of what a user will find when they click it. Generic, non-descriptive text like \"click here\" doesn't give an indication of what the link leads to. This descriptive title is shown when all links on the page have sufficient textual descriptions."
|
||||
},
|
||||
"lighthouse-core/audits/seo/manual/structured-data.js | description": {
|
||||
"message": "Run the [Structured Data Testing Tool](https://search.google.com/structured-data/testing-tool/) and the [Structured Data Linter](http://linter.structured-data.org/) to validate structured data. [Learn more](https://developers.google.com/search/docs/guides/mark-up-content).",
|
||||
"description": "Description of a Lighthouse audit that provides detail on the structured data in a page. \"Structured data\" is a standardized data format on a page that helps a search engine categorize and understand its contents. This description is displayed after a user expands the section to see more. No character length limits. 'Learn More' becomes link text to additional documentation."
|
||||
},
|
||||
"lighthouse-core/audits/seo/manual/structured-data.js | title": {
|
||||
"message": "Structured data is valid",
|
||||
"description": "Title of a Lighthouse audit that prompts users to manually check their page for valid structured data. \"Structured data\" is a standardized data format on a page that helps a search engine categorize and understand its contents."
|
||||
},
|
||||
"lighthouse-core/audits/seo/meta-description.js | description": {
|
||||
"message": "Meta descriptions may be included in search results to concisely summarize page content. [Learn more](https://developers.google.com/web/tools/lighthouse/audits/description).",
|
||||
"description": "Description of a Lighthouse audit that tells the user *why* they need to have meta descriptions on their page. This is displayed after a user expands the section to see more. No character length limits. 'Learn More' becomes link text to additional documentation."
|
||||
},
|
||||
"lighthouse-core/audits/seo/meta-description.js | explanation": {
|
||||
"message": "Description text is empty.",
|
||||
"description": "Explanatory message stating that there was a failure in an audit caused by the page's meta description text being empty."
|
||||
},
|
||||
"lighthouse-core/audits/seo/meta-description.js | failureTitle": {
|
||||
"message": "Document does not have a meta description",
|
||||
"description": "Title of a Lighthouse audit that provides detail on the web page's document meta description. This descriptive title is shown when the document does not have a meta description. \"meta\" should be left untranslated because it refers to an HTML element."
|
||||
},
|
||||
"lighthouse-core/audits/seo/meta-description.js | title": {
|
||||
"message": "Document has a meta description",
|
||||
"description": "Title of a Lighthouse audit that provides detail on the web page's document meta description. This descriptive title is shown when the document has a meta description. \"meta\" should be left untranslated because it refers to an HTML element."
|
||||
},
|
||||
"lighthouse-core/audits/seo/plugins.js | description": {
|
||||
"message": "Search engines can't index plugin content, and many devices restrict plugins or don't support them. [Learn more](https://developers.google.com/web/tools/lighthouse/audits/plugins).",
|
||||
"description": "Description of a Lighthouse audit that tells the user *why* they need to avoid using browser plugins in their content. This is displayed after a user expands the section to see more. No character length limits. 'Learn More' becomes link text to additional documentation."
|
||||
},
|
||||
"lighthouse-core/audits/seo/plugins.js | failureTitle": {
|
||||
"message": "Document uses plugins",
|
||||
"description": "Descriptive title of a Lighthouse audit that provides detail on the browser plugins used by the page. This title is shown when there is plugin content on the page."
|
||||
},
|
||||
"lighthouse-core/audits/seo/plugins.js | title": {
|
||||
"message": "Document avoids plugins",
|
||||
"description": "Title of a Lighthouse audit that provides detail on the browser plugins used by the page. This descriptive title is shown when there is no plugin content on the page that would restrict search indexing."
|
||||
},
|
||||
"lighthouse-core/audits/seo/robots-txt.js | description": {
|
||||
"message": "If your robots.txt file is malformed, crawlers may not be able to understand how you want your website to be crawled or indexed.",
|
||||
"description": "Description of a Lighthouse audit that tells the user *why* they need to have a valid robots.txt file. Note: \"robots.txt\" is a canonical filename and should not be translated. This is displayed after a user expands the section to see more. No character length limits."
|
||||
},
|
||||
"lighthouse-core/audits/seo/robots-txt.js | displayValueHttpBadCode": {
|
||||
"message": "request for robots.txt returned HTTP status: {statusCode, number}",
|
||||
"description": "[ICU Syntax] Label for the audit identifying that the robots.txt request has returned a specific HTTP status code. Note: \"robots.txt\" is a canonical filename and should not be translated. \"statusCode\" will be replaced with a 3 digit integer which represents the status of the HTTP connectiong for this page."
|
||||
},
|
||||
"lighthouse-core/audits/seo/robots-txt.js | displayValueValidationError": {
|
||||
"message": "{itemCount, plural,\n =1 {1 error found}\n other {# errors found}\n }",
|
||||
"description": "[ICU Syntax] Label for the audit identifying the number of errors that occured while validating the robots.txt file. \"itemCount\" will be replaced by the integer count of errors encountered."
|
||||
},
|
||||
"lighthouse-core/audits/seo/robots-txt.js | explanation": {
|
||||
"message": "Lighthouse was unable to download a robots.txt file",
|
||||
"description": "Explanatory message stating that there was a failure in an audit caused by Lighthouse not being able to download the robots.txt file for the site. Note: \"robots.txt\" is a canonical filename and should not be translated."
|
||||
},
|
||||
"lighthouse-core/audits/seo/robots-txt.js | failureTitle": {
|
||||
"message": "robots.txt is not valid",
|
||||
"description": "Title of a Lighthouse audit that provides detail on the site's robots.txt file. Note: \"robots.txt\" is a canonical filename and should not be translated. This descriptive title is shown when the robots.txt file is misconfigured, which makes the page hard or impossible to scan via web crawler."
|
||||
},
|
||||
"lighthouse-core/audits/seo/robots-txt.js | title": {
|
||||
"message": "robots.txt is valid",
|
||||
"description": "Title of a Lighthouse audit that provides detail on the site's robots.txt file. Note: \"robots.txt\" is a canonical filename and should not be translated. This descriptive title is shown when the robots.txt file is present and configured correctly."
|
||||
},
|
||||
"lighthouse-core/audits/seo/tap-targets.js | description": {
|
||||
"message": "Interactive elements like buttons and links should be large enough (48x48px), and have enough space around them, to be easy enough to tap without overlapping onto other elements. [Learn more](https://developers.google.com/web/fundamentals/accessibility/accessible-styles#multi-device_responsive_design).",
|
||||
|
@ -777,7 +937,7 @@
|
|||
},
|
||||
"lighthouse-core/audits/seo/tap-targets.js | failureTitle": {
|
||||
"message": "Tap targets are not sized appropriately",
|
||||
"description": "Title of a Lighthouse audit that provides detail on whether tap targets (like buttons and links) on a page are big enough so they can easily be tapped on a mobile device. This descriptive title is shown when tap targets are not easy to tap on."
|
||||
"description": "Descriptive title of a Lighthouse audit that provides detail on whether tap targets (like buttons and links) on a page are big enough so they can easily be tapped on a mobile device. This descriptive title is shown when tap targets are not easy to tap on."
|
||||
},
|
||||
"lighthouse-core/audits/seo/tap-targets.js | overlappingTargetHeader": {
|
||||
"message": "Overlapping Target",
|
||||
|
@ -991,6 +1151,18 @@
|
|||
"message": "PWA Optimized",
|
||||
"description": "Title of the \"PWA Optimized\" section of the web app category. Within this section are audits that check if the developer has taken advantage of features to make their web page more enjoyable and engaging for the user."
|
||||
},
|
||||
"lighthouse-core/config/default-config.js | seoCategoryDescription": {
|
||||
"message": "These checks ensure that your page is optimized for search engine results ranking. There are additional factors Lighthouse does not check that may affect your search ranking. [Learn more](https://support.google.com/webmasters/answer/35769).",
|
||||
"description": "Description of the Search Engine Optimization (SEO) category. This is displayed at the top of a list of audits focused on optimizing a website for indexing by search engines. No character length limits. 'Learn More' becomes link text to additional documentation."
|
||||
},
|
||||
"lighthouse-core/config/default-config.js | seoCategoryManualDescription": {
|
||||
"message": "Run these additional validators on your site to check additional SEO best practices.",
|
||||
"description": "Description of the Search Engine Optimization (SEO) manual checks category, the additional validators must be run by hand in order to check all SEO best practices. This is displayed at the top of a list of manually run audits focused on optimizing a website for indexing by search engines. No character length limits."
|
||||
},
|
||||
"lighthouse-core/config/default-config.js | seoCategoryTitle": {
|
||||
"message": "SEO",
|
||||
"description": "Title of the Search Engine Optimization (SEO) category of audits. This is displayed at the top of a list of audits focused on topics related to optimizing a website for indexing by search engines. Also used as a label of a score gauge; try to limit to 20 characters."
|
||||
},
|
||||
"lighthouse-core/lib/i18n/i18n.js | columnCacheTTL": {
|
||||
"message": "Cache TTL",
|
||||
"description": "Label for the TTL column in data tables, entries will be the time to live value of the cache header on a web resource"
|
||||
|
|
|
@ -52,7 +52,8 @@ describe('SEO: Document has valid canonical link', () => {
|
|||
const context = {computedCache: new Map()};
|
||||
return CanonicalAudit.audit(artifacts, context).then(auditResult => {
|
||||
assert.equal(auditResult.rawValue, false);
|
||||
assert.ok(auditResult.explanation.includes('Multiple'), auditResult.explanation);
|
||||
expect(auditResult.explanation)
|
||||
.toBeDisplayString('Multiple conflicting URLs (https://example.com, https://www.example.com)');
|
||||
});
|
||||
});
|
||||
|
||||
|
@ -118,7 +119,8 @@ describe('SEO: Document has valid canonical link', () => {
|
|||
const context = {computedCache: new Map()};
|
||||
return CanonicalAudit.audit(artifacts, context).then(auditResult => {
|
||||
assert.equal(auditResult.rawValue, false);
|
||||
assert.ok(auditResult.explanation.includes('hreflang'), auditResult.explanation);
|
||||
expect(auditResult.explanation)
|
||||
.toBeDisplayString('Points to another `hreflang` location (https://example.com/)');
|
||||
});
|
||||
});
|
||||
|
||||
|
@ -139,7 +141,8 @@ describe('SEO: Document has valid canonical link', () => {
|
|||
const context = {computedCache: new Map()};
|
||||
return CanonicalAudit.audit(artifacts, context).then(auditResult => {
|
||||
assert.equal(auditResult.rawValue, false);
|
||||
assert.ok(auditResult.explanation.includes('domain'), auditResult.explanation);
|
||||
expect(auditResult.explanation)
|
||||
.toBeDisplayString('Points to a different domain (https://example.com/)');
|
||||
});
|
||||
});
|
||||
|
||||
|
@ -160,7 +163,8 @@ describe('SEO: Document has valid canonical link', () => {
|
|||
const context = {computedCache: new Map()};
|
||||
return CanonicalAudit.audit(artifacts, context).then(auditResult => {
|
||||
assert.equal(auditResult.rawValue, false);
|
||||
assert.ok(auditResult.explanation.includes('root'), auditResult.explanation);
|
||||
expect(auditResult.explanation).toBeDisplayString('Points to the domain\'s root URL (the ' +
|
||||
'homepage), instead of an equivalent page of content');
|
||||
});
|
||||
});
|
||||
|
||||
|
|
|
@ -25,7 +25,9 @@ describe('SEO: Font size audit', () => {
|
|||
|
||||
const auditResult = FontSizeAudit.audit(artifacts);
|
||||
assert.equal(auditResult.rawValue, false);
|
||||
assert.ok(auditResult.explanation.includes('no viewport meta tag'));
|
||||
expect(auditResult.explanation)
|
||||
.toBeDisplayString('Text is illegible because there\'s ' +
|
||||
'no viewport meta tag optimized for mobile screens.');
|
||||
});
|
||||
|
||||
it('fails when less than 60% of text is legible', () => {
|
||||
|
@ -46,7 +48,7 @@ describe('SEO: Font size audit', () => {
|
|||
|
||||
const auditResult = FontSizeAudit.audit(artifacts);
|
||||
assert.equal(auditResult.rawValue, false);
|
||||
assert.ok(auditResult.explanation.includes('41%'));
|
||||
expect(auditResult.explanation).toBeDisplayString('41% of text is too small.');
|
||||
expect(auditResult.displayValue).toBeDisplayString('59% legible text');
|
||||
});
|
||||
|
||||
|
@ -167,7 +169,8 @@ describe('SEO: Font size audit', () => {
|
|||
};
|
||||
const auditResult = FontSizeAudit.audit(artifacts);
|
||||
assert.equal(auditResult.rawValue, false);
|
||||
assert.ok(auditResult.explanation.includes('50%'));
|
||||
expect(auditResult.explanation)
|
||||
.toBeDisplayString('100% of text is too small (based on 50% sample).');
|
||||
expect(auditResult.displayValue).toBeDisplayString('0% legible text');
|
||||
});
|
||||
|
||||
|
|
|
@ -25,7 +25,7 @@ describe('SEO: description audit', () => {
|
|||
MetaElements: makeMetaElements(''),
|
||||
});
|
||||
assert.equal(auditResult.rawValue, false);
|
||||
assert.ok(auditResult.explanation.includes('empty'), auditResult.explanation);
|
||||
expect(auditResult.explanation).toBeDisplayString('Description text is empty.');
|
||||
});
|
||||
|
||||
it('fails when description consists only of whitespace', () => {
|
||||
|
@ -33,7 +33,7 @@ describe('SEO: description audit', () => {
|
|||
MetaElements: makeMetaElements('\t\xa0'),
|
||||
});
|
||||
assert.equal(auditResult.rawValue, false);
|
||||
assert.ok(auditResult.explanation.includes('empty'), auditResult.explanation);
|
||||
expect(auditResult.explanation).toBeDisplayString('Description text is empty.');
|
||||
});
|
||||
|
||||
it('passes when a description text is provided', () => {
|
||||
|
|
|
@ -5437,6 +5437,18 @@
|
|||
"lighthouse-core/audits/dobetterweb/dom-size.js | statisticDOMWidth": [
|
||||
"audits[dom-size].details.items[2].statistic"
|
||||
],
|
||||
"lighthouse-core/audits/seo/meta-description.js | failureTitle": [
|
||||
"audits[meta-description].title"
|
||||
],
|
||||
"lighthouse-core/audits/seo/meta-description.js | description": [
|
||||
"audits[meta-description].description"
|
||||
],
|
||||
"lighthouse-core/audits/seo/http-status-code.js | title": [
|
||||
"audits[http-status-code].title"
|
||||
],
|
||||
"lighthouse-core/audits/seo/http-status-code.js | description": [
|
||||
"audits[http-status-code].description"
|
||||
],
|
||||
"lighthouse-core/audits/seo/font-size.js | title": [
|
||||
"audits[font-size].title"
|
||||
],
|
||||
|
@ -5451,12 +5463,54 @@
|
|||
"path": "audits[font-size].displayValue"
|
||||
}
|
||||
],
|
||||
"lighthouse-core/audits/seo/link-text.js | title": [
|
||||
"audits[link-text].title"
|
||||
],
|
||||
"lighthouse-core/audits/seo/link-text.js | description": [
|
||||
"audits[link-text].description"
|
||||
],
|
||||
"lighthouse-core/audits/seo/is-crawlable.js | failureTitle": [
|
||||
"audits[is-crawlable].title"
|
||||
],
|
||||
"lighthouse-core/audits/seo/is-crawlable.js | description": [
|
||||
"audits[is-crawlable].description"
|
||||
],
|
||||
"lighthouse-core/audits/seo/robots-txt.js | failureTitle": [
|
||||
"audits[robots-txt].title"
|
||||
],
|
||||
"lighthouse-core/audits/seo/robots-txt.js | description": [
|
||||
"audits[robots-txt].description"
|
||||
],
|
||||
"lighthouse-core/audits/seo/tap-targets.js | failureTitle": [
|
||||
"audits[tap-targets].title"
|
||||
],
|
||||
"lighthouse-core/audits/seo/tap-targets.js | description": [
|
||||
"audits[tap-targets].description"
|
||||
],
|
||||
"lighthouse-core/audits/seo/hreflang.js | title": [
|
||||
"audits.hreflang.title"
|
||||
],
|
||||
"lighthouse-core/audits/seo/hreflang.js | description": [
|
||||
"audits.hreflang.description"
|
||||
],
|
||||
"lighthouse-core/audits/seo/plugins.js | title": [
|
||||
"audits.plugins.title"
|
||||
],
|
||||
"lighthouse-core/audits/seo/plugins.js | description": [
|
||||
"audits.plugins.description"
|
||||
],
|
||||
"lighthouse-core/audits/seo/canonical.js | title": [
|
||||
"audits.canonical.title"
|
||||
],
|
||||
"lighthouse-core/audits/seo/canonical.js | description": [
|
||||
"audits.canonical.description"
|
||||
],
|
||||
"lighthouse-core/audits/seo/manual/structured-data.js | title": [
|
||||
"audits[structured-data].title"
|
||||
],
|
||||
"lighthouse-core/audits/seo/manual/structured-data.js | description": [
|
||||
"audits[structured-data].description"
|
||||
],
|
||||
"lighthouse-core/config/default-config.js | performanceCategoryTitle": [
|
||||
"categories.performance.title"
|
||||
],
|
||||
|
@ -5469,6 +5523,15 @@
|
|||
"lighthouse-core/config/default-config.js | a11yCategoryManualDescription": [
|
||||
"categories.accessibility.manualDescription"
|
||||
],
|
||||
"lighthouse-core/config/default-config.js | seoCategoryTitle": [
|
||||
"categories.seo.title"
|
||||
],
|
||||
"lighthouse-core/config/default-config.js | seoCategoryDescription": [
|
||||
"categories.seo.description"
|
||||
],
|
||||
"lighthouse-core/config/default-config.js | seoCategoryManualDescription": [
|
||||
"categories.seo.manualDescription"
|
||||
],
|
||||
"lighthouse-core/config/default-config.js | metricGroupTitle": [
|
||||
"categoryGroups.metrics.title"
|
||||
],
|
||||
|
|
Загрузка…
Ссылка в новой задаче