From 31d658b53eb75297b9c717ed485d2cf48762bc2c Mon Sep 17 00:00:00 2001 From: Shane Exterkamp Date: Fri, 21 Dec 2018 15:14:11 -0800 Subject: [PATCH 01/27] i18n v1 for SEO category. --- lighthouse-core/audits/seo/canonical.js | 45 +++-- lighthouse-core/audits/seo/font-size.js | 12 +- lighthouse-core/audits/seo/hreflang.js | 23 ++- .../audits/seo/http-status-code.js | 23 ++- lighthouse-core/audits/seo/is-crawlable.js | 23 ++- lighthouse-core/audits/seo/link-text.js | 29 +++- .../audits/seo/manual/mobile-friendly.js | 15 +- .../audits/seo/manual/structured-data.js | 15 +- .../audits/seo/meta-description.js | 27 ++- lighthouse-core/audits/seo/plugins.js | 23 ++- lighthouse-core/audits/seo/robots-txt.js | 38 +++- lighthouse-core/lib/i18n/en-US.json | 164 ++++++++++++++++++ .../test/audits/seo/canonical-test.js | 11 +- .../test/audits/seo/font-size-test.js | 8 +- .../test/audits/seo/meta-description-test.js | 4 +- lighthouse-core/test/results/sample_v2.json | 60 +++++++ 16 files changed, 453 insertions(+), 67 deletions(-) diff --git a/lighthouse-core/audits/seo/canonical.js b/lighthouse-core/audits/seo/canonical.js index b0032aed2a65..9f5609b87bc1 100644 --- a/lighthouse-core/audits/seo/canonical.js +++ b/lighthouse-core/audits/seo/canonical.js @@ -10,6 +10,31 @@ 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 = { + /** Imperative title of a Lighthouse audit that tells the user their site has a valid rel=canonical links. This is displayed in a list of audit titles that Lighthouse generates. */ + title: 'Document has a valid `rel=canonical`', + /** Imperative title of a Lighthouse audit that tells the user their site has a valid rel=canonical links. This imperative title is shown to users when the rel=canonical link is invalid. */ + 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. */ + explanationConflict: 'Multiple conflicting URLs ({urlList})', + /** [ICU Syntax] Explanatory message stating that there was a failure in an audit caused by a URL being invalid. */ + explanationInvalid: 'Invalid URL ({url})', + /** [ICU Syntax] Explanatory message stating that there was a failure in an audit caused by a URL being relative. */ + 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. */ + explanationPointsElsewhere: 'Points to another hreflang location ({href})', + /** [ICU Syntax] Explanatory message stating that there was a failure in an audit caused by a URL pointing to a different domain. */ + explanationDifferentDomain: 'Points to a different domain ({url})', + /** Explanatory message stating that there was a failure in an audit caused by a URL pointing to a root of the same origin. */ + explanationRoot: 'Points to a root of the same origin', +}; + +const str_ = i18n.createMessageInstanceIdFn(__filename, UIStrings); /** * @param {string} headerValue @@ -62,10 +87,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 +142,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 +151,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 +169,7 @@ class Canonical extends Audit { baseURL.href !== canonicalURL.href) { return { rawValue: false, - explanation: `Points to another hreflang location (${baseURL.href})`, + explanation: str_(UIStrings.explanationPointsElsewhere, {href: baseURL.href}), }; } @@ -154,7 +178,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 +187,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 +199,4 @@ class Canonical extends Audit { } module.exports = Canonical; +module.exports.UIStrings = UIStrings; diff --git a/lighthouse-core/audits/seo/font-size.js b/lighthouse-core/audits/seo/font-size.js index 352ffed80b6e..4eb04361192b 100644 --- a/lighthouse-core/audits/seo/font-size.js +++ b/lighthouse-core/audits/seo/font-size.js @@ -22,6 +22,10 @@ const UIStrings = { 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 config. */ + explanationViewport: 'Text is illegible because of a missing viewport config', + /** 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. */ + explanation: '{decimalProportion, number, extendedPercent} of text is too small{disclaimer}.', }; const str_ = i18n.createMessageInstanceIdFn(__filename, UIStrings); @@ -212,7 +216,7 @@ class FontSize extends Audit { if (!hasViewportSet) { return { rawValue: false, - explanation: 'Text is illegible because of a missing viewport config', + explanation: str_(UIStrings.explanationViewport), }; } @@ -285,7 +289,7 @@ class FontSize extends Audit { let explanation; if (!passed) { - const percentageOfFailingText = parseFloat((100 - percentageOfPassingText).toFixed(2)); + const percentageOfFailingText = parseFloat((100 - percentageOfPassingText).toFixed(2)) / 100; let disclaimer = ''; // if we were unable to visit all text nodes we should disclose that information @@ -293,8 +297,8 @@ class FontSize extends Audit { const percentageOfVisitedText = visitedTextLength / totalTextLength * 100; disclaimer = ` (based on ${percentageOfVisitedText.toFixed()}% sample)`; } - - explanation = `${percentageOfFailingText}% of text is too small${disclaimer}.`; + explanation = str_(UIStrings.explanation, + {decimalProportion: percentageOfFailingText, disclaimer}); } return { diff --git a/lighthouse-core/audits/seo/hreflang.js b/lighthouse-core/audits/seo/hreflang.js index 2c1784171391..5309af3c2c51 100644 --- a/lighthouse-core/audits/seo/hreflang.js +++ b/lighthouse-core/audits/seo/hreflang.js @@ -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 = { + /** Imperative title of a Lighthouse audit that tells the user the hreflang is valid for their site. This is displayed in a list of audit titles that Lighthouse generates. */ + title: 'Document has a valid `hreflang`', + /** Imperative title of a Lighthouse audit that tells the user the hreflang is valid for their site. This imperative title is shown when the site does not have a valid hreflang element. */ + 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. */ + 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'], }; } @@ -119,3 +131,4 @@ class Hreflang extends Audit { } module.exports = Hreflang; +module.exports.UIStrings = UIStrings; diff --git a/lighthouse-core/audits/seo/http-status-code.js b/lighthouse-core/audits/seo/http-status-code.js index cf80dc5252ab..f47802604d25 100644 --- a/lighthouse-core/audits/seo/http-status-code.js +++ b/lighthouse-core/audits/seo/http-status-code.js @@ -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 = { + /** Imperative title of a Lighthouse audit that tells the user their site has loaded with an appropriate HTTP status code. This is displayed in a list of audit titles that Lighthouse generates. */ + title: 'Page has successful HTTP status code', + /** Imperative title of a Lighthouse audit that tells the user their site has loaded with an appropriate HTTP status code. This imperative title is shown when a site has sent an invalid HTTP status code. */ + 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; diff --git a/lighthouse-core/audits/seo/is-crawlable.js b/lighthouse-core/audits/seo/is-crawlable.js index 2230f5a04c12..49aa7d7b3099 100644 --- a/lighthouse-core/audits/seo/is-crawlable.js +++ b/lighthouse-core/audits/seo/is-crawlable.js @@ -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 = { + /** Imperative title of a Lighthouse audit that tells the user their page is not blocked from being indexed by search engine crawlers. This is displayed in a list of audit titles that Lighthouse generates. */ + title: 'Page isn’t blocked from indexing', + /** Imperative title of a Lighthouse audit that tells the user their page is not blocked from being indexed by search engine crawlers. This imperative title is shown when the site has been blocked from indexing by search engine crawlers. */ + failureTitle: 'Page is blocked from indexing', + /** Description of a Lighthouse audit that tells the user *why* they need to allow crawling 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: '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: ['MetaRobots', 'RobotsTxt', 'URL'], }; } @@ -132,3 +144,4 @@ class IsCrawlable extends Audit { } module.exports = IsCrawlable; +module.exports.UIStrings = UIStrings; diff --git a/lighthouse-core/audits/seo/link-text.js b/lighthouse-core/audits/seo/link-text.js index d979e96fe13e..c3d061cd0186 100644 --- a/lighthouse-core/audits/seo/link-text.js +++ b/lighthouse-core/audits/seo/link-text.js @@ -18,6 +18,24 @@ const BLOCKLIST = new Set([ 'more', 'learn more', ]); +const i18n = require('../../lib/i18n/i18n.js'); + +const UIStrings = { + /** Imperative title of a Lighthouse audit that tells the user their links have descriptive enough text for a search engine crawler to parse them. This is displayed in a list of audit titles that Lighthouse generates. */ + title: 'Links have descriptive text', + /** Imperative title of a Lighthouse audit that tells the user their links have descriptive enough text for a search engine crawler to parse them. This imperative title is shown when there are links on the page without proper text to describe them. */ + 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).', + /** */ + 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', 'CrawlableLinks'], }; } @@ -68,8 +85,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 { @@ -81,3 +97,4 @@ class LinkText extends Audit { } module.exports = LinkText; +module.exports.UIStrings = UIStrings; diff --git a/lighthouse-core/audits/seo/manual/mobile-friendly.js b/lighthouse-core/audits/seo/manual/mobile-friendly.js index 402416a47f1b..431934fe4bdb 100644 --- a/lighthouse-core/audits/seo/manual/mobile-friendly.js +++ b/lighthouse-core/audits/seo/manual/mobile-friendly.js @@ -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 tells the user *why* and *how* they need to test their site to be mobile friendly. 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: 'Take the [Mobile-Friendly Test](https://search.google.com/test/mobile-friendly) to check for audits not covered by Lighthouse, like sizing tap targets appropriately. [Learn more](https://developers.google.com/search/mobile-sites/).', + /** Imperative title of a Lighthouse audit that tells the user that their page is setup to be compatible with mobile devices such as cellphones. This is displayed in a list of audit titles that Lighthouse generates. */ + title: 'Page is mobile friendly', +}; + +const str_ = i18n.createMessageInstanceIdFn(__filename, UIStrings); /** * @fileoverview Manual SEO audit to check if page is mobile friendly. @@ -18,10 +28,11 @@ class MobileFriendly extends ManualAudit { static get meta() { return Object.assign({ id: 'mobile-friendly', - description: 'Take the [Mobile-Friendly Test](https://search.google.com/test/mobile-friendly) to check for audits not covered by Lighthouse, like sizing tap targets appropriately. [Learn more](https://developers.google.com/search/mobile-sites/).', - title: 'Page is mobile friendly', + description: str_(UIStrings.description), + title: str_(UIStrings.title), }, super.partialMeta); } } module.exports = MobileFriendly; +module.exports.UIStrings = UIStrings; diff --git a/lighthouse-core/audits/seo/manual/structured-data.js b/lighthouse-core/audits/seo/manual/structured-data.js index e8386fc5727a..c258117721e9 100644 --- a/lighthouse-core/audits/seo/manual/structured-data.js +++ b/lighthouse-core/audits/seo/manual/structured-data.js @@ -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 tells the user *how* to test their page for using valid structured data. 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: '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).', + /** Imperative title of a Lighthouse audit that tells the user that their page has structured data. This is displayed in a list of audit titles that Lighthouse generates. */ + 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; diff --git a/lighthouse-core/audits/seo/meta-description.js b/lighthouse-core/audits/seo/meta-description.js index e3767257e83e..eca2a31f0957 100644 --- a/lighthouse-core/audits/seo/meta-description.js +++ b/lighthouse-core/audits/seo/meta-description.js @@ -6,6 +6,22 @@ 'use strict'; const Audit = require('../audit'); +const i18n = require('../../lib/i18n/i18n.js'); + +const UIStrings = { + /** Imperative title of a Lighthouse audit that tells the user that their site has a meta description element. This is displayed in a list of audit titles that Lighthouse generates. */ + title: 'Document has a meta description', + /** Imperative title of a Lighthouse audit that tells the user that their site has a meta description element. This imperative title is shown when a site does not have a valid meta description. */ + 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: ['MetaDescription'], }; } @@ -37,7 +51,7 @@ class Description extends Audit { if (artifacts.MetaDescription.trim().length === 0) { return { rawValue: false, - explanation: 'Description text is empty.', + explanation: str_(UIStrings.explanation), }; } @@ -48,3 +62,4 @@ class Description extends Audit { } module.exports = Description; +module.exports.UIStrings = UIStrings; diff --git a/lighthouse-core/audits/seo/plugins.js b/lighthouse-core/audits/seo/plugins.js index 30eff7e93adf..eef1a2673e59 100644 --- a/lighthouse-core/audits/seo/plugins.js +++ b/lighthouse-core/audits/seo/plugins.js @@ -31,6 +31,20 @@ const SOURCE_PARAMS = new Set([ 'source', 'src', ]); +const i18n = require('../../lib/i18n/i18n.js'); + +const UIStrings = { + /** Imperative title of a Lighthouse audit that tells the user that their site is able to be indexed by search engines because they do not use plugin content. This is displayed in a list of audit titles that Lighthouse generates. */ + title: 'Document avoids plugins', + /** Imperative title of a Lighthouse audit that tells the user that their site is able to be indexed by search engines because they do not use plugin content. This imperative title is shown when the site is using plugins and therefore cannot be indexed. */ + failureTitle: 'Document uses plugins', + /** Description of a Lighthouse audit that tells the user *why* they need to avoid using plugin 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'], }; } @@ -154,3 +166,4 @@ class Plugins extends Audit { } module.exports = Plugins; +module.exports.UIStrings = UIStrings; diff --git a/lighthouse-core/audits/seo/robots-txt.js b/lighthouse-core/audits/seo/robots-txt.js index bc7cdd25ede6..3eeddeb57ad2 100644 --- a/lighthouse-core/audits/seo/robots-txt.js +++ b/lighthouse-core/audits/seo/robots-txt.js @@ -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 = { + /** Imperative title of a Lighthouse audit that tells the user their site has a valid robots.txt file. This is displayed in a list of audit titles that Lighthouse generates. */ + title: 'robots.txt is valid', + /** Imperative title of a Lighthouse audit that tells the user their site has a valid robots.txt file. This imperative title is shown when the robots.txt is not valid for a site.*/ + 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. 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: '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. */ + displayValueHttpError: '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. */ + 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 page.*/ + explanation: 'Lighthouse was unable to download your 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.displayValueHttpError, {statusCode: status}), }; } else if (status >= HTTP_CLIENT_ERROR_CODE_LOW || content === '') { return { @@ -215,8 +236,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 { @@ -228,3 +249,4 @@ class RobotsTxt extends Audit { } module.exports = RobotsTxt; +module.exports.UIStrings = UIStrings; diff --git a/lighthouse-core/lib/i18n/en-US.json b/lighthouse-core/lib/i18n/en-US.json index c1e1a37f8dd9..eaac80acc023 100644 --- a/lighthouse-core/lib/i18n/en-US.json +++ b/lighthouse-core/lib/i18n/en-US.json @@ -727,6 +727,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." + }, + "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." + }, + "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." + }, + "lighthouse-core/audits/seo/canonical.js | explanationPointsElsewhere": { + "message": "Points to another hreflang location ({href})", + "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." + }, + "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." + }, + "lighthouse-core/audits/seo/canonical.js | explanationRoot": { + "message": "Points to a root of the same origin", + "description": "Explanatory message stating that there was a failure in an audit caused by a URL pointing to a root of the same origin." + }, + "lighthouse-core/audits/seo/canonical.js | failureTitle": { + "message": "Document does not have a valid `rel=canonical`", + "description": "Imperative title of a Lighthouse audit that tells the user their site has a valid rel=canonical links. This imperative title is shown to users when the rel=canonical link is invalid." + }, + "lighthouse-core/audits/seo/canonical.js | title": { + "message": "Document has a valid `rel=canonical`", + "description": "Imperative title of a Lighthouse audit that tells the user their site has a valid rel=canonical links. This is displayed in a list of audit titles that Lighthouse generates." + }, "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." @@ -735,6 +771,14 @@ "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{disclaimer}.", + "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." + }, + "lighthouse-core/audits/seo/font-size.js | explanationViewport": { + "message": "Text is illegible because of a missing viewport config", + "description": "Explanatory message stating that there was a failure in an audit caused by a missing page viewport config." + }, "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." @@ -743,6 +787,126 @@ "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." }, + "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." + }, + "lighthouse-core/audits/seo/hreflang.js | failureTitle": { + "message": "Document doesn't have a valid `hreflang`", + "description": "Imperative title of a Lighthouse audit that tells the user the hreflang is valid for their site. This imperative title is shown when the site does not have a valid hreflang element." + }, + "lighthouse-core/audits/seo/hreflang.js | title": { + "message": "Document has a valid `hreflang`", + "description": "Imperative title of a Lighthouse audit that tells the user the hreflang is valid for their site. This is displayed in a list of audit titles that Lighthouse generates." + }, + "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": "Imperative title of a Lighthouse audit that tells the user their site has loaded with an appropriate HTTP status code. This imperative title is shown when a site has sent an invalid HTTP status code." + }, + "lighthouse-core/audits/seo/http-status-code.js | title": { + "message": "Page has successful HTTP status code", + "description": "Imperative title of a Lighthouse audit that tells the user their site has loaded with an appropriate HTTP status code. This is displayed in a list of audit titles that Lighthouse generates." + }, + "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* they need to allow crawling 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/is-crawlable.js | failureTitle": { + "message": "Page is blocked from indexing", + "description": "Imperative title of a Lighthouse audit that tells the user their page is not blocked from being indexed by search engine crawlers. This imperative title is shown when the site has been blocked from indexing by search engine crawlers." + }, + "lighthouse-core/audits/seo/is-crawlable.js | title": { + "message": "Page isn’t blocked from indexing", + "description": "Imperative title of a Lighthouse audit that tells the user their page is not blocked from being indexed by search engine crawlers. This is displayed in a list of audit titles that Lighthouse generates." + }, + "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": "" + }, + "lighthouse-core/audits/seo/link-text.js | failureTitle": { + "message": "Links do not have descriptive text", + "description": "Imperative title of a Lighthouse audit that tells the user their links have descriptive enough text for a search engine crawler to parse them. This imperative title is shown when there are links on the page without proper text to describe them." + }, + "lighthouse-core/audits/seo/link-text.js | title": { + "message": "Links have descriptive text", + "description": "Imperative title of a Lighthouse audit that tells the user their links have descriptive enough text for a search engine crawler to parse them. This is displayed in a list of audit titles that Lighthouse generates." + }, + "lighthouse-core/audits/seo/manual/mobile-friendly.js | description": { + "message": "Take the [Mobile-Friendly Test](https://search.google.com/test/mobile-friendly) to check for audits not covered by Lighthouse, like sizing tap targets appropriately. [Learn more](https://developers.google.com/search/mobile-sites/).", + "description": "Description of a Lighthouse audit that tells the user *why* and *how* they need to test their site to be mobile friendly. 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/manual/mobile-friendly.js | title": { + "message": "Page is mobile friendly", + "description": "Imperative title of a Lighthouse audit that tells the user that their page is setup to be compatible with mobile devices such as cellphones. This is displayed in a list of audit titles that Lighthouse generates." + }, + "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 tells the user *how* to test their page for using valid structured data. 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/manual/structured-data.js | title": { + "message": "Structured data is valid", + "description": "Imperative title of a Lighthouse audit that tells the user that their page has structured data. This is displayed in a list of audit titles that Lighthouse generates." + }, + "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": "Imperative title of a Lighthouse audit that tells the user that their site has a meta description element. This imperative title is shown when a site does not have a valid meta description." + }, + "lighthouse-core/audits/seo/meta-description.js | title": { + "message": "Document has a meta description", + "description": "Imperative title of a Lighthouse audit that tells the user that their site has a meta description element. This is displayed in a list of audit titles that Lighthouse generates." + }, + "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 plugin 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": "Imperative title of a Lighthouse audit that tells the user that their site is able to be indexed by search engines because they do not use plugin content. This imperative title is shown when the site is using plugins and therefore cannot be indexed." + }, + "lighthouse-core/audits/seo/plugins.js | title": { + "message": "Document avoids plugins", + "description": "Imperative title of a Lighthouse audit that tells the user that their site is able to be indexed by search engines because they do not use plugin content. This is displayed in a list of audit titles that Lighthouse generates." + }, + "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. 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/robots-txt.js | displayValueHttpError": { + "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." + }, + "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." + }, + "lighthouse-core/audits/seo/robots-txt.js | explanation": { + "message": "Lighthouse was unable to download your 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 page." + }, + "lighthouse-core/audits/seo/robots-txt.js | failureTitle": { + "message": "robots.txt is not valid", + "description": "Imperative title of a Lighthouse audit that tells the user their site has a valid robots.txt file. This imperative title is shown when the robots.txt is not valid for a site." + }, + "lighthouse-core/audits/seo/robots-txt.js | title": { + "message": "robots.txt is valid", + "description": "Imperative title of a Lighthouse audit that tells the user their site has a valid robots.txt file. This is displayed in a list of audit titles that Lighthouse generates." + }, "lighthouse-core/audits/time-to-first-byte.js | description": { "message": "Time To First Byte identifies the time at which your server sends a response. [Learn more](https://developers.google.com/web/tools/lighthouse/audits/ttfb).", "description": "Description of a Lighthouse audit that tells the user *why* they should reduce the amount of time it takes their server to start responding to requests. This is displayed after a user expands the section to see more. No character length limits. 'Learn More' becomes link text to additional documentation." diff --git a/lighthouse-core/test/audits/seo/canonical-test.js b/lighthouse-core/test/audits/seo/canonical-test.js index 484b6023399d..d584b6317af3 100644 --- a/lighthouse-core/test/audits/seo/canonical-test.js +++ b/lighthouse-core/test/audits/seo/canonical-test.js @@ -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,7 @@ 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 a root of the same origin'); }); }); diff --git a/lighthouse-core/test/audits/seo/font-size-test.js b/lighthouse-core/test/audits/seo/font-size-test.js index 947eb7cb5101..cb57bbb16a53 100644 --- a/lighthouse-core/test/audits/seo/font-size-test.js +++ b/lighthouse-core/test/audits/seo/font-size-test.js @@ -23,7 +23,8 @@ describe('SEO: Font size audit', () => { const auditResult = FontSizeAudit.audit(artifacts); assert.equal(auditResult.rawValue, false); - assert.ok(auditResult.explanation.includes('missing viewport')); + expect(auditResult.explanation) + .toBeDisplayString('Text is illegible because of a missing viewport config'); }); it('fails when less than 60% of text is legible', () => { @@ -44,7 +45,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'); }); @@ -165,7 +166,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'); }); diff --git a/lighthouse-core/test/audits/seo/meta-description-test.js b/lighthouse-core/test/audits/seo/meta-description-test.js index 6f003654c091..a41a7950dc3d 100644 --- a/lighthouse-core/test/audits/seo/meta-description-test.js +++ b/lighthouse-core/test/audits/seo/meta-description-test.js @@ -23,7 +23,7 @@ describe('SEO: description audit', () => { MetaDescription: '', }); 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', () => { @@ -31,7 +31,7 @@ describe('SEO: description audit', () => { MetaDescription: '\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', () => { diff --git a/lighthouse-core/test/results/sample_v2.json b/lighthouse-core/test/results/sample_v2.json index 168f799e8ff0..059edf299a3a 100644 --- a/lighthouse-core/test/results/sample_v2.json +++ b/lighthouse-core/test/results/sample_v2.json @@ -4912,6 +4912,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" ], @@ -4926,6 +4938,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/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/mobile-friendly.js | title": [ + "audits[mobile-friendly].title" + ], + "lighthouse-core/audits/seo/manual/mobile-friendly.js | description": [ + "audits[mobile-friendly].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" ], From 8c799821dae4520355d17adae3dd480fad13a32d Mon Sep 17 00:00:00 2001 From: Shane Exterkamp Date: Fri, 21 Dec 2018 15:24:01 -0800 Subject: [PATCH 02/27] Add link text test for multiple. Added link text displayValue label. --- lighthouse-core/audits/seo/link-text.js | 2 +- .../test/audits/seo/link-text-test.js | 22 +++++++++++++++++++ 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/lighthouse-core/audits/seo/link-text.js b/lighthouse-core/audits/seo/link-text.js index c3d061cd0186..095b4816dcd0 100644 --- a/lighthouse-core/audits/seo/link-text.js +++ b/lighthouse-core/audits/seo/link-text.js @@ -28,7 +28,7 @@ const UIStrings = { /** 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. */ displayValue: `{itemCount, plural, =1 {1 link found} other {# links found} diff --git a/lighthouse-core/test/audits/seo/link-text-test.js b/lighthouse-core/test/audits/seo/link-text-test.js index 6fce06b0b76f..9e364733c442 100644 --- a/lighthouse-core/test/audits/seo/link-text-test.js +++ b/lighthouse-core/test/audits/seo/link-text-test.js @@ -29,6 +29,28 @@ describe('SEO: link text audit', () => { assert.equal(auditResult.details.items.length, 1); assert.equal(auditResult.details.items[0].href, invalidLink.href); assert.equal(auditResult.details.items[0].text, invalidLink.text); + expect(auditResult.displayValue).toBeDisplayString('1 link found'); + }); + + it('fails when multiple links with non descriptive text is found', () => { + const invalidLink = {href: 'https://example.com/otherpage.html', text: 'click here'}; + const invalidLink2 = {href: 'https://example.com/otherpage.html', text: 'click here'}; + const artifacts = { + URL: { + finalUrl: 'https://example.com/page.html', + }, + CrawlableLinks: [ + {href: 'https://example.com/otherpage.html', text: 'legit link text'}, + invalidLink, + invalidLink2, + {href: 'https://example.com/otherpage.html', text: 'legit link text'}, + ], + }; + + const auditResult = LinkTextAudit.audit(artifacts); + assert.equal(auditResult.rawValue, false); + assert.equal(auditResult.details.items.length, 2); + expect(auditResult.displayValue).toBeDisplayString('2 links found'); }); it('ignores links pointing to the main document', () => { From c8b9f58f242fed55297e37ee8f9ab12254b0d083 Mon Sep 17 00:00:00 2001 From: Shane Exterkamp Date: Wed, 2 Jan 2019 11:10:28 -0800 Subject: [PATCH 03/27] Removed imperative and reworded some description texts. --- lighthouse-core/audits/seo/canonical.js | 6 +-- lighthouse-core/audits/seo/font-size.js | 6 +-- lighthouse-core/audits/seo/hreflang.js | 4 +- .../audits/seo/http-status-code.js | 4 +- lighthouse-core/audits/seo/is-crawlable.js | 4 +- lighthouse-core/audits/seo/link-text.js | 4 +- .../audits/seo/manual/mobile-friendly.js | 2 +- .../audits/seo/manual/structured-data.js | 2 +- .../audits/seo/meta-description.js | 4 +- lighthouse-core/audits/seo/plugins.js | 4 +- lighthouse-core/audits/seo/robots-txt.js | 4 +- lighthouse-core/lib/i18n/en-US.json | 46 +++++++++---------- 12 files changed, 45 insertions(+), 45 deletions(-) diff --git a/lighthouse-core/audits/seo/canonical.js b/lighthouse-core/audits/seo/canonical.js index 9f5609b87bc1..4b1a8ad21ca7 100644 --- a/lighthouse-core/audits/seo/canonical.js +++ b/lighthouse-core/audits/seo/canonical.js @@ -13,9 +13,9 @@ const LINK_HEADER = 'link'; const i18n = require('../../lib/i18n/i18n.js'); const UIStrings = { - /** Imperative title of a Lighthouse audit that tells the user their site has a valid rel=canonical links. This is displayed in a list of audit titles that Lighthouse generates. */ + /** Title of a Lighthouse audit that tells the user their site has a valid rel=canonical links. This is displayed in a list of audit titles that Lighthouse generates. */ title: 'Document has a valid `rel=canonical`', - /** Imperative title of a Lighthouse audit that tells the user their site has a valid rel=canonical links. This imperative title is shown to users when the rel=canonical link is invalid. */ + /** Title of a Lighthouse audit that tells the user their site has a valid rel=canonical links. This title is shown to users when the rel=canonical link is invalid. */ 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. ' + @@ -24,7 +24,7 @@ const UIStrings = { explanationConflict: 'Multiple conflicting URLs ({urlList})', /** [ICU Syntax] Explanatory message stating that there was a failure in an audit caused by a URL being invalid. */ explanationInvalid: 'Invalid URL ({url})', - /** [ICU Syntax] Explanatory message stating that there was a failure in an audit caused by a URL being relative. */ + /** [ICU Syntax] Explanatory message stating that there was a failure in an audit caused by a URL being relative instead of absolute. */ 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. */ explanationPointsElsewhere: 'Points to another hreflang location ({href})', diff --git a/lighthouse-core/audits/seo/font-size.js b/lighthouse-core/audits/seo/font-size.js index 4eb04361192b..6841e2ac3301 100644 --- a/lighthouse-core/audits/seo/font-size.js +++ b/lighthouse-core/audits/seo/font-size.js @@ -14,15 +14,15 @@ 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 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: '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 tells the user that they should use font sizes that are easily read by the user. This title is shown to users when there is a font that is too small to be read by the user. */ 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 config. */ + /** Explanatory message stating that there was a failure in an audit caused by a missing page viewport meta tag configuration. */ explanationViewport: 'Text is illegible because of a missing viewport config', /** 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. */ explanation: '{decimalProportion, number, extendedPercent} of text is too small{disclaimer}.', diff --git a/lighthouse-core/audits/seo/hreflang.js b/lighthouse-core/audits/seo/hreflang.js index 5309af3c2c51..a65fc028a50c 100644 --- a/lighthouse-core/audits/seo/hreflang.js +++ b/lighthouse-core/audits/seo/hreflang.js @@ -14,9 +14,9 @@ const NO_LANGUAGE = 'x-default'; const i18n = require('../../lib/i18n/i18n.js'); const UIStrings = { - /** Imperative title of a Lighthouse audit that tells the user the hreflang is valid for their site. This is displayed in a list of audit titles that Lighthouse generates. */ + /** Title of a Lighthouse audit that analyzes a page for an hreflang element. This is displayed in a list of audit titles that Lighthouse generates. */ title: 'Document has a valid `hreflang`', - /** Imperative title of a Lighthouse audit that tells the user the hreflang is valid for their site. This imperative title is shown when the site does not have a valid hreflang element. */ + /** Title of a Lighthouse audit that analyzes a page for an hreflang element. This title is shown when the site does not have a valid hreflang element. */ 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. */ description: 'hreflang links tell search engines what version of a page they should ' + diff --git a/lighthouse-core/audits/seo/http-status-code.js b/lighthouse-core/audits/seo/http-status-code.js index f47802604d25..3b62000653c3 100644 --- a/lighthouse-core/audits/seo/http-status-code.js +++ b/lighthouse-core/audits/seo/http-status-code.js @@ -12,9 +12,9 @@ const HTTP_UNSUCCESSFUL_CODE_HIGH = 599; const i18n = require('../../lib/i18n/i18n.js'); const UIStrings = { - /** Imperative title of a Lighthouse audit that tells the user their site has loaded with an appropriate HTTP status code. This is displayed in a list of audit titles that Lighthouse generates. */ + /** Title of a Lighthouse audit that tells the user their site has loaded with an appropriate HTTP status code. This is displayed in a list of audit titles that Lighthouse generates. */ title: 'Page has successful HTTP status code', - /** Imperative title of a Lighthouse audit that tells the user their site has loaded with an appropriate HTTP status code. This imperative title is shown when a site has sent an invalid HTTP status code. */ + /** Title of a Lighthouse audit that tells the user their site has loaded with an appropriate HTTP status code. This title is shown when a site has sent an invalid HTTP status code. */ 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. ' + diff --git a/lighthouse-core/audits/seo/is-crawlable.js b/lighthouse-core/audits/seo/is-crawlable.js index 49aa7d7b3099..4a3cf0e98a3c 100644 --- a/lighthouse-core/audits/seo/is-crawlable.js +++ b/lighthouse-core/audits/seo/is-crawlable.js @@ -18,9 +18,9 @@ const UNAVAILABLE_AFTER = 'unavailable_after'; const i18n = require('../../lib/i18n/i18n.js'); const UIStrings = { - /** Imperative title of a Lighthouse audit that tells the user their page is not blocked from being indexed by search engine crawlers. This is displayed in a list of audit titles that Lighthouse generates. */ + /** Title of a Lighthouse audit that tells the user their page is not blocked from being indexed by search engine crawlers. This is displayed in a list of audit titles that Lighthouse generates. */ title: 'Page isn’t blocked from indexing', - /** Imperative title of a Lighthouse audit that tells the user their page is not blocked from being indexed by search engine crawlers. This imperative title is shown when the site has been blocked from indexing by search engine crawlers. */ + /** Title of a Lighthouse audit that tells the user their page is not blocked from being indexed by search engine crawlers. This title is shown when the site has been blocked from indexing by search engine crawlers. */ failureTitle: 'Page is blocked from indexing', /** Description of a Lighthouse audit that tells the user *why* they need to allow crawling 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: 'Search engines are unable to include your pages in search results ' + diff --git a/lighthouse-core/audits/seo/link-text.js b/lighthouse-core/audits/seo/link-text.js index 095b4816dcd0..ca038f39343e 100644 --- a/lighthouse-core/audits/seo/link-text.js +++ b/lighthouse-core/audits/seo/link-text.js @@ -21,9 +21,9 @@ const BLOCKLIST = new Set([ const i18n = require('../../lib/i18n/i18n.js'); const UIStrings = { - /** Imperative title of a Lighthouse audit that tells the user their links have descriptive enough text for a search engine crawler to parse them. This is displayed in a list of audit titles that Lighthouse generates. */ + /** Title of a Lighthouse audit that tells the user their links have descriptive enough text for a search engine crawler to parse them. This is displayed in a list of audit titles that Lighthouse generates. */ title: 'Links have descriptive text', - /** Imperative title of a Lighthouse audit that tells the user their links have descriptive enough text for a search engine crawler to parse them. This imperative title is shown when there are links on the page without proper text to describe them. */ + /** Title of a Lighthouse audit that tells the user their links have descriptive enough text for a search engine crawler to parse them. This title is shown when there are links on the page without proper text to describe them. */ 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. ' + diff --git a/lighthouse-core/audits/seo/manual/mobile-friendly.js b/lighthouse-core/audits/seo/manual/mobile-friendly.js index 431934fe4bdb..9f58541e3606 100644 --- a/lighthouse-core/audits/seo/manual/mobile-friendly.js +++ b/lighthouse-core/audits/seo/manual/mobile-friendly.js @@ -11,7 +11,7 @@ const i18n = require('../../../lib/i18n/i18n.js'); const UIStrings = { /** Description of a Lighthouse audit that tells the user *why* and *how* they need to test their site to be mobile friendly. 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: 'Take the [Mobile-Friendly Test](https://search.google.com/test/mobile-friendly) to check for audits not covered by Lighthouse, like sizing tap targets appropriately. [Learn more](https://developers.google.com/search/mobile-sites/).', - /** Imperative title of a Lighthouse audit that tells the user that their page is setup to be compatible with mobile devices such as cellphones. This is displayed in a list of audit titles that Lighthouse generates. */ + /** Title of a Lighthouse audit that tells the user that their page is setup to be compatible with mobile devices such as cellphones. This is displayed in a list of audit titles that Lighthouse generates. */ title: 'Page is mobile friendly', }; diff --git a/lighthouse-core/audits/seo/manual/structured-data.js b/lighthouse-core/audits/seo/manual/structured-data.js index c258117721e9..34679ebe2611 100644 --- a/lighthouse-core/audits/seo/manual/structured-data.js +++ b/lighthouse-core/audits/seo/manual/structured-data.js @@ -11,7 +11,7 @@ const i18n = require('../../../lib/i18n/i18n.js'); const UIStrings = { /** Description of a Lighthouse audit that tells the user *how* to test their page for using valid structured data. 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: '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).', - /** Imperative title of a Lighthouse audit that tells the user that their page has structured data. This is displayed in a list of audit titles that Lighthouse generates. */ + /** Title of a Lighthouse audit that tells the user that their page has structured data. This is displayed in a list of audit titles that Lighthouse generates. */ title: 'Structured data is valid', }; diff --git a/lighthouse-core/audits/seo/meta-description.js b/lighthouse-core/audits/seo/meta-description.js index eca2a31f0957..40ddb4e6c907 100644 --- a/lighthouse-core/audits/seo/meta-description.js +++ b/lighthouse-core/audits/seo/meta-description.js @@ -9,9 +9,9 @@ const Audit = require('../audit'); const i18n = require('../../lib/i18n/i18n.js'); const UIStrings = { - /** Imperative title of a Lighthouse audit that tells the user that their site has a meta description element. This is displayed in a list of audit titles that Lighthouse generates. */ + /** Title of a Lighthouse audit that tells the user that their site has a meta description element. This is displayed in a list of audit titles that Lighthouse generates. */ title: 'Document has a meta description', - /** Imperative title of a Lighthouse audit that tells the user that their site has a meta description element. This imperative title is shown when a site does not have a valid meta description. */ + /** Title of a Lighthouse audit that tells the user that their site has a meta description element. This title is shown when a site does not have a valid meta description. */ 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 ' + diff --git a/lighthouse-core/audits/seo/plugins.js b/lighthouse-core/audits/seo/plugins.js index eef1a2673e59..13e61fa53258 100644 --- a/lighthouse-core/audits/seo/plugins.js +++ b/lighthouse-core/audits/seo/plugins.js @@ -34,9 +34,9 @@ const SOURCE_PARAMS = new Set([ const i18n = require('../../lib/i18n/i18n.js'); const UIStrings = { - /** Imperative title of a Lighthouse audit that tells the user that their site is able to be indexed by search engines because they do not use plugin content. This is displayed in a list of audit titles that Lighthouse generates. */ + /** Title of a Lighthouse audit that tells the user that their site is able to be indexed by search engines because they do not use plugin content. This is displayed in a list of audit titles that Lighthouse generates. */ title: 'Document avoids plugins', - /** Imperative title of a Lighthouse audit that tells the user that their site is able to be indexed by search engines because they do not use plugin content. This imperative title is shown when the site is using plugins and therefore cannot be indexed. */ + /** Title of a Lighthouse audit that tells the user that their site is able to be indexed by search engines because they do not use plugin content. This title is shown when the site is using plugins and therefore cannot be indexed. */ failureTitle: 'Document uses plugins', /** Description of a Lighthouse audit that tells the user *why* they need to avoid using plugin 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 ' + diff --git a/lighthouse-core/audits/seo/robots-txt.js b/lighthouse-core/audits/seo/robots-txt.js index 3eeddeb57ad2..aad3e2e5640b 100644 --- a/lighthouse-core/audits/seo/robots-txt.js +++ b/lighthouse-core/audits/seo/robots-txt.js @@ -34,9 +34,9 @@ const SITEMAP_VALID_PROTOCOLS = new Set(['https:', 'http:', 'ftp:']); const i18n = require('../../lib/i18n/i18n.js'); const UIStrings = { - /** Imperative title of a Lighthouse audit that tells the user their site has a valid robots.txt file. This is displayed in a list of audit titles that Lighthouse generates. */ + /** Title of a Lighthouse audit that tells the user their site has a valid robots.txt file. This is displayed in a list of audit titles that Lighthouse generates. */ title: 'robots.txt is valid', - /** Imperative title of a Lighthouse audit that tells the user their site has a valid robots.txt file. This imperative title is shown when the robots.txt is not valid for a site.*/ + /** Title of a Lighthouse audit that tells the user their site has a valid robots.txt file. This title is shown when the robots.txt is not valid for a site.*/ 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. 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: 'If your robots.txt file is malformed, crawlers may not be able to understand ' + diff --git a/lighthouse-core/lib/i18n/en-US.json b/lighthouse-core/lib/i18n/en-US.json index eaac80acc023..838bd92cd324 100644 --- a/lighthouse-core/lib/i18n/en-US.json +++ b/lighthouse-core/lib/i18n/en-US.json @@ -749,7 +749,7 @@ }, "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." + "description": "[ICU Syntax] Explanatory message stating that there was a failure in an audit caused by a URL being relative instead of absolute." }, "lighthouse-core/audits/seo/canonical.js | explanationRoot": { "message": "Points to a root of the same origin", @@ -757,11 +757,11 @@ }, "lighthouse-core/audits/seo/canonical.js | failureTitle": { "message": "Document does not have a valid `rel=canonical`", - "description": "Imperative title of a Lighthouse audit that tells the user their site has a valid rel=canonical links. This imperative title is shown to users when the rel=canonical link is invalid." + "description": "Title of a Lighthouse audit that tells the user their site has a valid rel=canonical links. This title is shown to users when the rel=canonical link is invalid." }, "lighthouse-core/audits/seo/canonical.js | title": { "message": "Document has a valid `rel=canonical`", - "description": "Imperative title of a Lighthouse audit that tells the user their site has a valid rel=canonical links. This is displayed in a list of audit titles that Lighthouse generates." + "description": "Title of a Lighthouse audit that tells the user their site has a valid rel=canonical links. This is displayed in a list of audit titles that Lighthouse generates." }, "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).", @@ -777,15 +777,15 @@ }, "lighthouse-core/audits/seo/font-size.js | explanationViewport": { "message": "Text is illegible because of a missing viewport config", - "description": "Explanatory message stating that there was a failure in an audit caused by a missing page viewport config." + "description": "Explanatory message stating that there was a failure in an audit caused by a missing page viewport meta tag configuration." }, "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 tells the user that they should use font sizes that are easily read by the user. This title is shown to users when there is a font that is too small to be read by the user." }, "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 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." }, "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).", @@ -793,11 +793,11 @@ }, "lighthouse-core/audits/seo/hreflang.js | failureTitle": { "message": "Document doesn't have a valid `hreflang`", - "description": "Imperative title of a Lighthouse audit that tells the user the hreflang is valid for their site. This imperative title is shown when the site does not have a valid hreflang element." + "description": "Title of a Lighthouse audit that analyzes a page for an hreflang element. This title is shown when the site does not have a valid hreflang element." }, "lighthouse-core/audits/seo/hreflang.js | title": { "message": "Document has a valid `hreflang`", - "description": "Imperative title of a Lighthouse audit that tells the user the hreflang is valid for their site. This is displayed in a list of audit titles that Lighthouse generates." + "description": "Title of a Lighthouse audit that analyzes a page for an hreflang element. This is displayed in a list of audit titles that Lighthouse generates." }, "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).", @@ -805,11 +805,11 @@ }, "lighthouse-core/audits/seo/http-status-code.js | failureTitle": { "message": "Page has unsuccessful HTTP status code", - "description": "Imperative title of a Lighthouse audit that tells the user their site has loaded with an appropriate HTTP status code. This imperative title is shown when a site has sent an invalid HTTP status code." + "description": "Title of a Lighthouse audit that tells the user their site has loaded with an appropriate HTTP status code. This title is shown when a site has sent an invalid HTTP status code." }, "lighthouse-core/audits/seo/http-status-code.js | title": { "message": "Page has successful HTTP status code", - "description": "Imperative title of a Lighthouse audit that tells the user their site has loaded with an appropriate HTTP status code. This is displayed in a list of audit titles that Lighthouse generates." + "description": "Title of a Lighthouse audit that tells the user their site has loaded with an appropriate HTTP status code. This is displayed in a list of audit titles that Lighthouse generates." }, "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).", @@ -817,11 +817,11 @@ }, "lighthouse-core/audits/seo/is-crawlable.js | failureTitle": { "message": "Page is blocked from indexing", - "description": "Imperative title of a Lighthouse audit that tells the user their page is not blocked from being indexed by search engine crawlers. This imperative title is shown when the site has been blocked from indexing by search engine crawlers." + "description": "Title of a Lighthouse audit that tells the user their page is not blocked from being indexed by search engine crawlers. This title is shown when the site has been blocked from indexing by search engine crawlers." }, "lighthouse-core/audits/seo/is-crawlable.js | title": { "message": "Page isn’t blocked from indexing", - "description": "Imperative title of a Lighthouse audit that tells the user their page is not blocked from being indexed by search engine crawlers. This is displayed in a list of audit titles that Lighthouse generates." + "description": "Title of a Lighthouse audit that tells the user their page is not blocked from being indexed by search engine crawlers. This is displayed in a list of audit titles that Lighthouse generates." }, "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).", @@ -829,15 +829,15 @@ }, "lighthouse-core/audits/seo/link-text.js | displayValue": { "message": "{itemCount, plural,\n =1 {1 link found}\n other {# links found}\n }", - "description": "" + "description": "[ICU Syntax] Label for the audit identifying the number of links found." }, "lighthouse-core/audits/seo/link-text.js | failureTitle": { "message": "Links do not have descriptive text", - "description": "Imperative title of a Lighthouse audit that tells the user their links have descriptive enough text for a search engine crawler to parse them. This imperative title is shown when there are links on the page without proper text to describe them." + "description": "Title of a Lighthouse audit that tells the user their links have descriptive enough text for a search engine crawler to parse them. This title is shown when there are links on the page without proper text to describe them." }, "lighthouse-core/audits/seo/link-text.js | title": { "message": "Links have descriptive text", - "description": "Imperative title of a Lighthouse audit that tells the user their links have descriptive enough text for a search engine crawler to parse them. This is displayed in a list of audit titles that Lighthouse generates." + "description": "Title of a Lighthouse audit that tells the user their links have descriptive enough text for a search engine crawler to parse them. This is displayed in a list of audit titles that Lighthouse generates." }, "lighthouse-core/audits/seo/manual/mobile-friendly.js | description": { "message": "Take the [Mobile-Friendly Test](https://search.google.com/test/mobile-friendly) to check for audits not covered by Lighthouse, like sizing tap targets appropriately. [Learn more](https://developers.google.com/search/mobile-sites/).", @@ -845,7 +845,7 @@ }, "lighthouse-core/audits/seo/manual/mobile-friendly.js | title": { "message": "Page is mobile friendly", - "description": "Imperative title of a Lighthouse audit that tells the user that their page is setup to be compatible with mobile devices such as cellphones. This is displayed in a list of audit titles that Lighthouse generates." + "description": "Title of a Lighthouse audit that tells the user that their page is setup to be compatible with mobile devices such as cellphones. This is displayed in a list of audit titles that Lighthouse generates." }, "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).", @@ -853,7 +853,7 @@ }, "lighthouse-core/audits/seo/manual/structured-data.js | title": { "message": "Structured data is valid", - "description": "Imperative title of a Lighthouse audit that tells the user that their page has structured data. This is displayed in a list of audit titles that Lighthouse generates." + "description": "Title of a Lighthouse audit that tells the user that their page has structured data. This is displayed in a list of audit titles that Lighthouse generates." }, "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).", @@ -865,11 +865,11 @@ }, "lighthouse-core/audits/seo/meta-description.js | failureTitle": { "message": "Document does not have a meta description", - "description": "Imperative title of a Lighthouse audit that tells the user that their site has a meta description element. This imperative title is shown when a site does not have a valid meta description." + "description": "Title of a Lighthouse audit that tells the user that their site has a meta description element. This title is shown when a site does not have a valid meta description." }, "lighthouse-core/audits/seo/meta-description.js | title": { "message": "Document has a meta description", - "description": "Imperative title of a Lighthouse audit that tells the user that their site has a meta description element. This is displayed in a list of audit titles that Lighthouse generates." + "description": "Title of a Lighthouse audit that tells the user that their site has a meta description element. This is displayed in a list of audit titles that Lighthouse generates." }, "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).", @@ -877,11 +877,11 @@ }, "lighthouse-core/audits/seo/plugins.js | failureTitle": { "message": "Document uses plugins", - "description": "Imperative title of a Lighthouse audit that tells the user that their site is able to be indexed by search engines because they do not use plugin content. This imperative title is shown when the site is using plugins and therefore cannot be indexed." + "description": "Title of a Lighthouse audit that tells the user that their site is able to be indexed by search engines because they do not use plugin content. This title is shown when the site is using plugins and therefore cannot be indexed." }, "lighthouse-core/audits/seo/plugins.js | title": { "message": "Document avoids plugins", - "description": "Imperative title of a Lighthouse audit that tells the user that their site is able to be indexed by search engines because they do not use plugin content. This is displayed in a list of audit titles that Lighthouse generates." + "description": "Title of a Lighthouse audit that tells the user that their site is able to be indexed by search engines because they do not use plugin content. This is displayed in a list of audit titles that Lighthouse generates." }, "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.", @@ -901,11 +901,11 @@ }, "lighthouse-core/audits/seo/robots-txt.js | failureTitle": { "message": "robots.txt is not valid", - "description": "Imperative title of a Lighthouse audit that tells the user their site has a valid robots.txt file. This imperative title is shown when the robots.txt is not valid for a site." + "description": "Title of a Lighthouse audit that tells the user their site has a valid robots.txt file. This title is shown when the robots.txt is not valid for a site." }, "lighthouse-core/audits/seo/robots-txt.js | title": { "message": "robots.txt is valid", - "description": "Imperative title of a Lighthouse audit that tells the user their site has a valid robots.txt file. This is displayed in a list of audit titles that Lighthouse generates." + "description": "Title of a Lighthouse audit that tells the user their site has a valid robots.txt file. This is displayed in a list of audit titles that Lighthouse generates." }, "lighthouse-core/audits/time-to-first-byte.js | description": { "message": "Time To First Byte identifies the time at which your server sends a response. [Learn more](https://developers.google.com/web/tools/lighthouse/audits/ttfb).", From 42d8dda31a708c206a109023c14b448565988813 Mon Sep 17 00:00:00 2001 From: Shane Exterkamp Date: Wed, 2 Jan 2019 12:52:00 -0800 Subject: [PATCH 04/27] Added multi-messages for font-size. --- lighthouse-core/audits/seo/canonical.js | 2 +- lighthouse-core/audits/seo/font-size.js | 19 +++++++++++++------ lighthouse-core/lib/i18n/en-US.json | 8 ++++++-- 3 files changed, 20 insertions(+), 9 deletions(-) diff --git a/lighthouse-core/audits/seo/canonical.js b/lighthouse-core/audits/seo/canonical.js index 4b1a8ad21ca7..3c791edd06bd 100644 --- a/lighthouse-core/audits/seo/canonical.js +++ b/lighthouse-core/audits/seo/canonical.js @@ -30,7 +30,7 @@ const UIStrings = { explanationPointsElsewhere: 'Points to another hreflang location ({href})', /** [ICU Syntax] Explanatory message stating that there was a failure in an audit caused by a URL pointing to a different domain. */ explanationDifferentDomain: 'Points to a different domain ({url})', - /** Explanatory message stating that there was a failure in an audit caused by a URL pointing to a root of the same origin. */ + /** Explanatory message stating that the page's canonical URL was pointing to a root of the same origin which is a common mistake. The canonical URL should point a different page with the same content whose URL is preferred, not a parent or root page. */ explanationRoot: 'Points to a root of the same origin', }; diff --git a/lighthouse-core/audits/seo/font-size.js b/lighthouse-core/audits/seo/font-size.js index 6841e2ac3301..283b11a1a51c 100644 --- a/lighthouse-core/audits/seo/font-size.js +++ b/lighthouse-core/audits/seo/font-size.js @@ -25,7 +25,10 @@ const UIStrings = { /** Explanatory message stating that there was a failure in an audit caused by a missing page viewport meta tag configuration. */ explanationViewport: 'Text is illegible because of a missing viewport config', /** 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. */ - explanation: '{decimalProportion, number, extendedPercent} of text is too small{disclaimer}.', + 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. */ + explanationWithDisclaimer: '{decimalProportion, number, extendedPercent} of text is too ' + + 'small (based on {decimalProportionVisited, number, extendedPercent} sample).', }; const str_ = i18n.createMessageInstanceIdFn(__filename, UIStrings); @@ -290,15 +293,19 @@ class FontSize extends Audit { let explanation; if (!passed) { const percentageOfFailingText = parseFloat((100 - percentageOfPassingText).toFixed(2)) / 100; - let disclaimer = ''; // 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).toFixed(2); + explanation = str_(UIStrings.explanationWithDisclaimer, + { + decimalProportion: percentageOfFailingText, + decimalProportionVisited: percentageOfVisitedText, + }); + } else { + explanation = str_(UIStrings.explanation, + {decimalProportion: percentageOfFailingText}); } - explanation = str_(UIStrings.explanation, - {decimalProportion: percentageOfFailingText, disclaimer}); } return { diff --git a/lighthouse-core/lib/i18n/en-US.json b/lighthouse-core/lib/i18n/en-US.json index 838bd92cd324..d661565570fb 100644 --- a/lighthouse-core/lib/i18n/en-US.json +++ b/lighthouse-core/lib/i18n/en-US.json @@ -753,7 +753,7 @@ }, "lighthouse-core/audits/seo/canonical.js | explanationRoot": { "message": "Points to a root of the same origin", - "description": "Explanatory message stating that there was a failure in an audit caused by a URL pointing to a root of the same origin." + "description": "Explanatory message stating that the page's canonical URL was pointing to a root of the same origin which is a common mistake. The canonical URL should point a different page with the same content whose URL is preferred, not a parent or root page." }, "lighthouse-core/audits/seo/canonical.js | failureTitle": { "message": "Document does not have a valid `rel=canonical`", @@ -772,13 +772,17 @@ "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{disclaimer}.", + "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." }, "lighthouse-core/audits/seo/font-size.js | explanationViewport": { "message": "Text is illegible because of a missing viewport config", "description": "Explanatory message stating that there was a failure in an audit caused by a missing page viewport meta tag configuration." }, + "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." + }, "lighthouse-core/audits/seo/font-size.js | failureTitle": { "message": "Document doesn't use legible font sizes", "description": "Title of a Lighthouse audit that tells the user that they should use font sizes that are easily read by the user. This title is shown to users when there is a font that is too small to be read by the user." From 60fc6b9223e7280d91b092bd3c5a3fe2d96a9308 Mon Sep 17 00:00:00 2001 From: Shane Exterkamp Date: Wed, 2 Jan 2019 16:05:16 -0800 Subject: [PATCH 05/27] Reworded title descriptions based on feedback. --- lighthouse-core/audits/seo/canonical.js | 4 +- lighthouse-core/audits/seo/font-size.js | 4 +- lighthouse-core/audits/seo/hreflang.js | 4 +- .../audits/seo/http-status-code.js | 4 +- lighthouse-core/audits/seo/is-crawlable.js | 4 +- lighthouse-core/audits/seo/link-text.js | 4 +- .../audits/seo/manual/mobile-friendly.js | 4 +- .../audits/seo/manual/structured-data.js | 4 +- .../audits/seo/meta-description.js | 4 +- lighthouse-core/audits/seo/plugins.js | 4 +- lighthouse-core/audits/seo/robots-txt.js | 4 +- lighthouse-core/lib/i18n/en-US.json | 44 +++++++++---------- 12 files changed, 44 insertions(+), 44 deletions(-) diff --git a/lighthouse-core/audits/seo/canonical.js b/lighthouse-core/audits/seo/canonical.js index 3c791edd06bd..c14ac720e8c4 100644 --- a/lighthouse-core/audits/seo/canonical.js +++ b/lighthouse-core/audits/seo/canonical.js @@ -13,9 +13,9 @@ const LINK_HEADER = 'link'; const i18n = require('../../lib/i18n/i18n.js'); const UIStrings = { - /** Title of a Lighthouse audit that tells the user their site has a valid rel=canonical links. This is displayed in a list of audit titles that Lighthouse generates. */ + /** 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. */ title: 'Document has a valid `rel=canonical`', - /** Title of a Lighthouse audit that tells the user their site has a valid rel=canonical links. This title is shown to users when the rel=canonical link is invalid. */ + /** Title of a Lighthouse audit that provides detail on a page's rel=canonical link. This imperative title is shown to users when the rel=canonical link is invalid and should be fixed. */ 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. ' + diff --git a/lighthouse-core/audits/seo/font-size.js b/lighthouse-core/audits/seo/font-size.js index 283b11a1a51c..25498521352b 100644 --- a/lighthouse-core/audits/seo/font-size.js +++ b/lighthouse-core/audits/seo/font-size.js @@ -14,9 +14,9 @@ const ViewportAudit = require('../viewport'); const MINIMAL_PERCENTAGE_OF_LEGIBLE_TEXT = 60; const UIStrings = { - /** 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', - /** Title of a Lighthouse audit that tells the user that they should use font sizes that are easily read by the user. This 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 imperative title is shown to users when there is a font that is too small to be read by the user. */ 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).', diff --git a/lighthouse-core/audits/seo/hreflang.js b/lighthouse-core/audits/seo/hreflang.js index a65fc028a50c..7ea160b852e3 100644 --- a/lighthouse-core/audits/seo/hreflang.js +++ b/lighthouse-core/audits/seo/hreflang.js @@ -14,9 +14,9 @@ const NO_LANGUAGE = 'x-default'; const i18n = require('../../lib/i18n/i18n.js'); const UIStrings = { - /** Title of a Lighthouse audit that analyzes a page for an hreflang element. This is displayed in a list of audit titles that Lighthouse generates. */ + /** Title of a Lighthouse audit that provides detail on the `hreflang` element on a page. This descriptive title is shown when the `hreflang` element is configured correctly. */ title: 'Document has a valid `hreflang`', - /** Title of a Lighthouse audit that analyzes a page for an hreflang element. This title is shown when the site does not have a valid hreflang element. */ + /** Title of a Lighthouse audit that provides detail on the `hreflang` element on a page. This imperative title is shown when the `hreflang` element is not valid and needs to be fixed. */ 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. */ description: 'hreflang links tell search engines what version of a page they should ' + diff --git a/lighthouse-core/audits/seo/http-status-code.js b/lighthouse-core/audits/seo/http-status-code.js index 3b62000653c3..d90c88827d4c 100644 --- a/lighthouse-core/audits/seo/http-status-code.js +++ b/lighthouse-core/audits/seo/http-status-code.js @@ -12,9 +12,9 @@ const HTTP_UNSUCCESSFUL_CODE_HIGH = 599; const i18n = require('../../lib/i18n/i18n.js'); const UIStrings = { - /** Title of a Lighthouse audit that tells the user their site has loaded with an appropriate HTTP status code. This is displayed in a list of audit titles that Lighthouse generates. */ + /** 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', - /** Title of a Lighthouse audit that tells the user their site has loaded with an appropriate HTTP status code. This title is shown when a site has sent an invalid HTTP status code. */ + /** Title of a Lighthouse audit that provides detail on the HTTP status code a page responds with. This imperative 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. ' + diff --git a/lighthouse-core/audits/seo/is-crawlable.js b/lighthouse-core/audits/seo/is-crawlable.js index 4a3cf0e98a3c..7ae4c7101843 100644 --- a/lighthouse-core/audits/seo/is-crawlable.js +++ b/lighthouse-core/audits/seo/is-crawlable.js @@ -18,9 +18,9 @@ const UNAVAILABLE_AFTER = 'unavailable_after'; const i18n = require('../../lib/i18n/i18n.js'); const UIStrings = { - /** Title of a Lighthouse audit that tells the user their page is not blocked from being indexed by search engine crawlers. This is displayed in a list of audit titles that Lighthouse generates. */ + /** Title of a Lighthouse audit that provides detail on the blocking status of their page in regards to search-engine index crawling. This descriptive 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 tells the user their page is not blocked from being indexed by search engine crawlers. This title is shown when the site has been blocked from indexing by search engine crawlers. */ + /** Title of a Lighthouse audit that provides detail on the blocking status of their page in regards to search-engine index crawling. This imperative 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* they need to allow crawling 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: 'Search engines are unable to include your pages in search results ' + diff --git a/lighthouse-core/audits/seo/link-text.js b/lighthouse-core/audits/seo/link-text.js index ca038f39343e..c4a7c8f2697d 100644 --- a/lighthouse-core/audits/seo/link-text.js +++ b/lighthouse-core/audits/seo/link-text.js @@ -21,9 +21,9 @@ const BLOCKLIST = new Set([ const i18n = require('../../lib/i18n/i18n.js'); const UIStrings = { - /** Title of a Lighthouse audit that tells the user their links have descriptive enough text for a search engine crawler to parse them. This is displayed in a list of audit titles that Lighthouse generates. */ + /** Title of a Lighthouse audit that provides detail on the text descriptions used for links on the page. 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 tells the user their links have descriptive enough text for a search engine crawler to parse them. This title is shown when there are links on the page without proper text to describe them. */ + /** Title of a Lighthouse audit that provides detail on the text descriptions used for links on the page. This imperative title is shown when one or more links on the page do not have enough text describing them to be considered valid when being crawled by a search engine. */ 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. ' + diff --git a/lighthouse-core/audits/seo/manual/mobile-friendly.js b/lighthouse-core/audits/seo/manual/mobile-friendly.js index 9f58541e3606..6c4e61035d85 100644 --- a/lighthouse-core/audits/seo/manual/mobile-friendly.js +++ b/lighthouse-core/audits/seo/manual/mobile-friendly.js @@ -9,9 +9,9 @@ const ManualAudit = require('../../manual/manual-audit'); const i18n = require('../../../lib/i18n/i18n.js'); const UIStrings = { - /** Description of a Lighthouse audit that tells the user *why* and *how* they need to test their site to be mobile friendly. 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 of a Lighthouse audit that provides detail on how well the page is setup to be compatible with mobile devices such as cellphones. 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: 'Take the [Mobile-Friendly Test](https://search.google.com/test/mobile-friendly) to check for audits not covered by Lighthouse, like sizing tap targets appropriately. [Learn more](https://developers.google.com/search/mobile-sites/).', - /** Title of a Lighthouse audit that tells the user that their page is setup to be compatible with mobile devices such as cellphones. This is displayed in a list of audit titles that Lighthouse generates. */ + /** Title of a Lighthouse audit that provides detail on how well the page is setup to be compatible with mobile devices such as cellphones. This is displayed in a list of audit titles that Lighthouse generates. */ title: 'Page is mobile friendly', }; diff --git a/lighthouse-core/audits/seo/manual/structured-data.js b/lighthouse-core/audits/seo/manual/structured-data.js index 34679ebe2611..b6c419d97c1f 100644 --- a/lighthouse-core/audits/seo/manual/structured-data.js +++ b/lighthouse-core/audits/seo/manual/structured-data.js @@ -9,9 +9,9 @@ const ManualAudit = require('../../manual/manual-audit'); const i18n = require('../../../lib/i18n/i18n.js'); const UIStrings = { - /** Description of a Lighthouse audit that tells the user *how* to test their page for using valid structured data. 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 of a Lighthouse audit that provides detail on the structured data in a 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: '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 tells the user that their page has structured data. This is displayed in a list of audit titles that Lighthouse generates. */ + /** Title of a Lighthouse audit that provides detail on the structured data in a page. This is displayed in a list of audit titles that Lighthouse generates. */ title: 'Structured data is valid', }; diff --git a/lighthouse-core/audits/seo/meta-description.js b/lighthouse-core/audits/seo/meta-description.js index 40ddb4e6c907..194d499de925 100644 --- a/lighthouse-core/audits/seo/meta-description.js +++ b/lighthouse-core/audits/seo/meta-description.js @@ -9,9 +9,9 @@ const Audit = require('../audit'); const i18n = require('../../lib/i18n/i18n.js'); const UIStrings = { - /** Title of a Lighthouse audit that tells the user that their site has a meta description element. This is displayed in a list of audit titles that Lighthouse generates. */ + /** 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. */ title: 'Document has a meta description', - /** Title of a Lighthouse audit that tells the user that their site has a meta description element. This title is shown when a site does not have a valid meta description. */ + /** Title of a Lighthouse audit that provides detail on the web page's document meta description. This imperative title is shown when the document does not have a meta description. */ 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 ' + diff --git a/lighthouse-core/audits/seo/plugins.js b/lighthouse-core/audits/seo/plugins.js index 13e61fa53258..8d34400bd5ae 100644 --- a/lighthouse-core/audits/seo/plugins.js +++ b/lighthouse-core/audits/seo/plugins.js @@ -34,9 +34,9 @@ const SOURCE_PARAMS = new Set([ const i18n = require('../../lib/i18n/i18n.js'); const UIStrings = { - /** Title of a Lighthouse audit that tells the user that their site is able to be indexed by search engines because they do not use plugin content. This is displayed in a list of audit titles that Lighthouse generates. */ + /** Title of a Lighthouse audit that provides detail on the plugin content found in 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', - /** Title of a Lighthouse audit that tells the user that their site is able to be indexed by search engines because they do not use plugin content. This title is shown when the site is using plugins and therefore cannot be indexed. */ + /** Title of a Lighthouse audit that provides detail on the plugin content found in the page. This imperative title is shown when there is plugin content on the page which cannot be indexed by search engine crawlers. */ failureTitle: 'Document uses plugins', /** Description of a Lighthouse audit that tells the user *why* they need to avoid using plugin 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 ' + diff --git a/lighthouse-core/audits/seo/robots-txt.js b/lighthouse-core/audits/seo/robots-txt.js index aad3e2e5640b..9ea04bb46cf0 100644 --- a/lighthouse-core/audits/seo/robots-txt.js +++ b/lighthouse-core/audits/seo/robots-txt.js @@ -34,9 +34,9 @@ const SITEMAP_VALID_PROTOCOLS = new Set(['https:', 'http:', 'ftp:']); const i18n = require('../../lib/i18n/i18n.js'); const UIStrings = { - /** Title of a Lighthouse audit that tells the user their site has a valid robots.txt file. This is displayed in a list of audit titles that Lighthouse generates. */ + /** Title of a Lighthouse audit that provides detail on the robots.txt file on the page. 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 tells the user their site has a valid robots.txt file. This title is shown when the robots.txt is not valid for a site.*/ + /** Title of a Lighthouse audit that provides detail on the robots.txt file on the page. This imperative 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. 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: 'If your robots.txt file is malformed, crawlers may not be able to understand ' + diff --git a/lighthouse-core/lib/i18n/en-US.json b/lighthouse-core/lib/i18n/en-US.json index d661565570fb..b6488f0d809f 100644 --- a/lighthouse-core/lib/i18n/en-US.json +++ b/lighthouse-core/lib/i18n/en-US.json @@ -757,11 +757,11 @@ }, "lighthouse-core/audits/seo/canonical.js | failureTitle": { "message": "Document does not have a valid `rel=canonical`", - "description": "Title of a Lighthouse audit that tells the user their site has a valid rel=canonical links. This title is shown to users when the rel=canonical link is invalid." + "description": "Title of a Lighthouse audit that provides detail on a page's rel=canonical link. This imperative title is shown to users when the rel=canonical link is invalid and should be fixed." }, "lighthouse-core/audits/seo/canonical.js | title": { "message": "Document has a valid `rel=canonical`", - "description": "Title of a Lighthouse audit that tells the user their site has a valid rel=canonical links. This is displayed in a list of audit titles that Lighthouse generates." + "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." }, "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).", @@ -785,11 +785,11 @@ }, "lighthouse-core/audits/seo/font-size.js | failureTitle": { "message": "Document doesn't use legible font sizes", - "description": "Title of a Lighthouse audit that tells the user that they should use font sizes that are easily read by the user. This 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 imperative title is shown to users when there is a font that is too small to be read by the user." }, "lighthouse-core/audits/seo/font-size.js | title": { "message": "Document uses legible font sizes", - "description": "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).", @@ -797,11 +797,11 @@ }, "lighthouse-core/audits/seo/hreflang.js | failureTitle": { "message": "Document doesn't have a valid `hreflang`", - "description": "Title of a Lighthouse audit that analyzes a page for an hreflang element. This title is shown when the site does not have a valid hreflang element." + "description": "Title of a Lighthouse audit that provides detail on the `hreflang` element on a page. This imperative title is shown when the `hreflang` element is not valid and needs to be fixed." }, "lighthouse-core/audits/seo/hreflang.js | title": { "message": "Document has a valid `hreflang`", - "description": "Title of a Lighthouse audit that analyzes a page for an hreflang element. This is displayed in a list of audit titles that Lighthouse generates." + "description": "Title of a Lighthouse audit that provides detail on the `hreflang` element on a page. This descriptive title is shown when the `hreflang` element is configured correctly." }, "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).", @@ -809,11 +809,11 @@ }, "lighthouse-core/audits/seo/http-status-code.js | failureTitle": { "message": "Page has unsuccessful HTTP status code", - "description": "Title of a Lighthouse audit that tells the user their site has loaded with an appropriate HTTP status code. This title is shown when a site has sent an invalid HTTP status code." + "description": "Title of a Lighthouse audit that provides detail on the HTTP status code a page responds with. This imperative 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 tells the user their site has loaded with an appropriate HTTP status code. This is displayed in a list of audit titles that Lighthouse generates." + "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).", @@ -821,11 +821,11 @@ }, "lighthouse-core/audits/seo/is-crawlable.js | failureTitle": { "message": "Page is blocked from indexing", - "description": "Title of a Lighthouse audit that tells the user their page is not blocked from being indexed by search engine crawlers. This title is shown when the site has been blocked from indexing by search engine crawlers." + "description": "Title of a Lighthouse audit that provides detail on the blocking status of their page in regards to search-engine index crawling. This imperative 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 tells the user their page is not blocked from being indexed by search engine crawlers. This is displayed in a list of audit titles that Lighthouse generates." + "description": "Title of a Lighthouse audit that provides detail on the blocking status of their page in regards to search-engine index crawling. This descriptive 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).", @@ -837,27 +837,27 @@ }, "lighthouse-core/audits/seo/link-text.js | failureTitle": { "message": "Links do not have descriptive text", - "description": "Title of a Lighthouse audit that tells the user their links have descriptive enough text for a search engine crawler to parse them. This title is shown when there are links on the page without proper text to describe them." + "description": "Title of a Lighthouse audit that provides detail on the text descriptions used for links on the page. This imperative title is shown when one or more links on the page do not have enough text describing them to be considered valid when being crawled by a search engine." }, "lighthouse-core/audits/seo/link-text.js | title": { "message": "Links have descriptive text", - "description": "Title of a Lighthouse audit that tells the user their links have descriptive enough text for a search engine crawler to parse them. This is displayed in a list of audit titles that Lighthouse generates." + "description": "Title of a Lighthouse audit that provides detail on the text descriptions used for links on the page. This descriptive title is shown when all links on the page have sufficient textual descriptions." }, "lighthouse-core/audits/seo/manual/mobile-friendly.js | description": { "message": "Take the [Mobile-Friendly Test](https://search.google.com/test/mobile-friendly) to check for audits not covered by Lighthouse, like sizing tap targets appropriately. [Learn more](https://developers.google.com/search/mobile-sites/).", - "description": "Description of a Lighthouse audit that tells the user *why* and *how* they need to test their site to be mobile friendly. 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": "Description of a Lighthouse audit that provides detail on how well the page is setup to be compatible with mobile devices such as cellphones. 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/manual/mobile-friendly.js | title": { "message": "Page is mobile friendly", - "description": "Title of a Lighthouse audit that tells the user that their page is setup to be compatible with mobile devices such as cellphones. This is displayed in a list of audit titles that Lighthouse generates." + "description": "Title of a Lighthouse audit that provides detail on how well the page is setup to be compatible with mobile devices such as cellphones. This is displayed in a list of audit titles that Lighthouse generates." }, "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 tells the user *how* to test their page for using valid structured data. 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": "Description of a Lighthouse audit that provides detail on the structured data in a 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/manual/structured-data.js | title": { "message": "Structured data is valid", - "description": "Title of a Lighthouse audit that tells the user that their page has structured data. This is displayed in a list of audit titles that Lighthouse generates." + "description": "Title of a Lighthouse audit that provides detail on the structured data in a page. This is displayed in a list of audit titles that Lighthouse generates." }, "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).", @@ -869,11 +869,11 @@ }, "lighthouse-core/audits/seo/meta-description.js | failureTitle": { "message": "Document does not have a meta description", - "description": "Title of a Lighthouse audit that tells the user that their site has a meta description element. This title is shown when a site does not have a valid meta description." + "description": "Title of a Lighthouse audit that provides detail on the web page's document meta description. This imperative title is shown when the document does not have a meta description." }, "lighthouse-core/audits/seo/meta-description.js | title": { "message": "Document has a meta description", - "description": "Title of a Lighthouse audit that tells the user that their site has a meta description element. This is displayed in a list of audit titles that Lighthouse generates." + "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." }, "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).", @@ -881,11 +881,11 @@ }, "lighthouse-core/audits/seo/plugins.js | failureTitle": { "message": "Document uses plugins", - "description": "Title of a Lighthouse audit that tells the user that their site is able to be indexed by search engines because they do not use plugin content. This title is shown when the site is using plugins and therefore cannot be indexed." + "description": "Title of a Lighthouse audit that provides detail on the plugin content found in the page. This imperative title is shown when there is plugin content on the page which cannot be indexed by search engine crawlers." }, "lighthouse-core/audits/seo/plugins.js | title": { "message": "Document avoids plugins", - "description": "Title of a Lighthouse audit that tells the user that their site is able to be indexed by search engines because they do not use plugin content. This is displayed in a list of audit titles that Lighthouse generates." + "description": "Title of a Lighthouse audit that provides detail on the plugin content found in 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.", @@ -905,11 +905,11 @@ }, "lighthouse-core/audits/seo/robots-txt.js | failureTitle": { "message": "robots.txt is not valid", - "description": "Title of a Lighthouse audit that tells the user their site has a valid robots.txt file. This title is shown when the robots.txt is not valid for a site." + "description": "Title of a Lighthouse audit that provides detail on the robots.txt file on the page. This imperative 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 tells the user their site has a valid robots.txt file. This is displayed in a list of audit titles that Lighthouse generates." + "description": "Title of a Lighthouse audit that provides detail on the robots.txt file on the page. This descriptive title is shown when the robots.txt file is present and configured correctly." }, "lighthouse-core/audits/time-to-first-byte.js | description": { "message": "Time To First Byte identifies the time at which your server sends a response. [Learn more](https://developers.google.com/web/tools/lighthouse/audits/ttfb).", From 8306ee75f1327603e8bcb297f0296d0ef555be48 Mon Sep 17 00:00:00 2001 From: Shane Exterkamp Date: Tue, 29 Jan 2019 15:30:50 -0800 Subject: [PATCH 06/27] Add SEO title i18n, fix tests. --- lighthouse-core/config/default-config.js | 4 +++- lighthouse-core/lib/i18n/en-US.json | 4 ++++ lighthouse-core/test/audits/seo/font-size-test.js | 3 ++- lighthouse-core/test/results/sample_v2.json | 3 +++ 4 files changed, 12 insertions(+), 2 deletions(-) diff --git a/lighthouse-core/config/default-config.js b/lighthouse-core/config/default-config.js index fb018545bf90..2438f71725c1 100644 --- a/lighthouse-core/config/default-config.js +++ b/lighthouse-core/config/default-config.js @@ -13,6 +13,8 @@ const i18n = require('../lib/i18n/i18n.js'); const UIStrings = { /** Title of the Performance category of audits. Equivalent to 'Web performance', this term is inclusive of all web page speed and loading optimization topics. Also used as a label of a score gauge; try to limit to 20 characters. */ performanceCategoryTitle: 'Performance', + /** Title of the Search Engine Optimization (SEO) category of audits. Used commonly as the acronym SEO, this term includes all 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', /** Title of the speed metrics section of the Performance category. Within this section are various speed metrics which quantify the pageload performance into values presented in seconds and milliseconds. */ metricGroupTitle: 'Metrics', /** Title of the opportunity section of the Performance category. Within this section are audits with imperative titles that suggest actions the user can take to improve the loading performance of their web page. 'Suggestion'/'Optimization'/'Recommendation' are reasonable synonyms for 'opportunity' in this case. */ @@ -432,7 +434,7 @@ const defaultConfig = { ], }, 'seo': { - title: 'SEO', + title: str_(UIStrings.seoCategoryTitle), 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).', diff --git a/lighthouse-core/lib/i18n/en-US.json b/lighthouse-core/lib/i18n/en-US.json index 55cb6f2a00cf..f4a4b688290e 100644 --- a/lighthouse-core/lib/i18n/en-US.json +++ b/lighthouse-core/lib/i18n/en-US.json @@ -1091,6 +1091,10 @@ "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 | seoCategoryTitle": { + "message": "SEO", + "description": "Title of the Search Engine Optimization (SEO) category of audits. Used commonly as the acronym SEO, this term includes all 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" diff --git a/lighthouse-core/test/audits/seo/font-size-test.js b/lighthouse-core/test/audits/seo/font-size-test.js index d7210aa5397c..ee6612d092da 100644 --- a/lighthouse-core/test/audits/seo/font-size-test.js +++ b/lighthouse-core/test/audits/seo/font-size-test.js @@ -26,7 +26,8 @@ describe('SEO: Font size audit', () => { const auditResult = FontSizeAudit.audit(artifacts); assert.equal(auditResult.rawValue, false); expect(auditResult.explanation) - .toBeDisplayString('Text is illegible because of a missing viewport config'); + .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', () => { diff --git a/lighthouse-core/test/results/sample_v2.json b/lighthouse-core/test/results/sample_v2.json index 13c4ce2726f3..bd6aa589c792 100644 --- a/lighthouse-core/test/results/sample_v2.json +++ b/lighthouse-core/test/results/sample_v2.json @@ -5062,6 +5062,9 @@ "lighthouse-core/config/default-config.js | performanceCategoryTitle": [ "categories.performance.title" ], + "lighthouse-core/config/default-config.js | seoCategoryTitle": [ + "categories.seo.title" + ], "lighthouse-core/config/default-config.js | metricGroupTitle": [ "categoryGroups.metrics.title" ], From 2c8eea04bfc88a56fdf77b497c5d41aa2f70e5fe Mon Sep 17 00:00:00 2001 From: Shane Exterkamp Date: Tue, 29 Jan 2019 15:42:17 -0800 Subject: [PATCH 07/27] Category description i18n. --- lighthouse-core/config/default-config.js | 12 +++++++----- lighthouse-core/lib/i18n/en-US.json | 4 ++++ lighthouse-core/test/results/sample_v2.json | 3 +++ 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/lighthouse-core/config/default-config.js b/lighthouse-core/config/default-config.js index 2438f71725c1..6133ad174924 100644 --- a/lighthouse-core/config/default-config.js +++ b/lighthouse-core/config/default-config.js @@ -13,8 +13,6 @@ const i18n = require('../lib/i18n/i18n.js'); const UIStrings = { /** Title of the Performance category of audits. Equivalent to 'Web performance', this term is inclusive of all web page speed and loading optimization topics. Also used as a label of a score gauge; try to limit to 20 characters. */ performanceCategoryTitle: 'Performance', - /** Title of the Search Engine Optimization (SEO) category of audits. Used commonly as the acronym SEO, this term includes all 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', /** Title of the speed metrics section of the Performance category. Within this section are various speed metrics which quantify the pageload performance into values presented in seconds and milliseconds. */ metricGroupTitle: 'Metrics', /** Title of the opportunity section of the Performance category. Within this section are audits with imperative titles that suggest actions the user can take to improve the loading performance of their web page. 'Suggestion'/'Optimization'/'Recommendation' are reasonable synonyms for 'opportunity' in this case. */ @@ -65,6 +63,12 @@ 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. Used commonly as the acronym SEO, this term includes all 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 immediately under the SEO title element. 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).', /** 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. */ @@ -435,9 +439,7 @@ const defaultConfig = { }, 'seo': { title: str_(UIStrings.seoCategoryTitle), - 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).', + description: str_(UIStrings.seoCategoryDescription), manualDescription: 'Run these additional validators on your site to check additional SEO best practices.', auditRefs: [ {id: 'viewport', weight: 1, group: 'seo-mobile'}, diff --git a/lighthouse-core/lib/i18n/en-US.json b/lighthouse-core/lib/i18n/en-US.json index f4a4b688290e..2cb7f8bb0099 100644 --- a/lighthouse-core/lib/i18n/en-US.json +++ b/lighthouse-core/lib/i18n/en-US.json @@ -1091,6 +1091,10 @@ "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 immediately under the SEO title element. No character length limits. 'Learn More' becomes link text to additional documentation." + }, "lighthouse-core/config/default-config.js | seoCategoryTitle": { "message": "SEO", "description": "Title of the Search Engine Optimization (SEO) category of audits. Used commonly as the acronym SEO, this term includes all 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." diff --git a/lighthouse-core/test/results/sample_v2.json b/lighthouse-core/test/results/sample_v2.json index bd6aa589c792..c92af1a51263 100644 --- a/lighthouse-core/test/results/sample_v2.json +++ b/lighthouse-core/test/results/sample_v2.json @@ -5065,6 +5065,9 @@ "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 | metricGroupTitle": [ "categoryGroups.metrics.title" ], From ffa4e7c067088b8cafba4b49096c2bf60a22b1c9 Mon Sep 17 00:00:00 2001 From: Shane Exterkamp Date: Tue, 29 Jan 2019 15:46:57 -0800 Subject: [PATCH 08/27] Add manual audit category desc. --- lighthouse-core/config/default-config.js | 4 +++- lighthouse-core/lib/i18n/en-US.json | 4 ++++ lighthouse-core/test/results/sample_v2.json | 3 +++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/lighthouse-core/config/default-config.js b/lighthouse-core/config/default-config.js index 6133ad174924..8c6bb97803d5 100644 --- a/lighthouse-core/config/default-config.js +++ b/lighthouse-core/config/default-config.js @@ -69,6 +69,8 @@ const UIStrings = { 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 above the manual checks section of the SEO category. 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. */ @@ -440,7 +442,7 @@ const defaultConfig = { 'seo': { title: str_(UIStrings.seoCategoryTitle), description: str_(UIStrings.seoCategoryDescription), - manualDescription: 'Run these additional validators on your site to check additional SEO best practices.', + manualDescription: str_(UIStrings.seoCategoryManualDescription), auditRefs: [ {id: 'viewport', weight: 1, group: 'seo-mobile'}, {id: 'document-title', weight: 1, group: 'seo-content'}, diff --git a/lighthouse-core/lib/i18n/en-US.json b/lighthouse-core/lib/i18n/en-US.json index 2cb7f8bb0099..b366d7f70f31 100644 --- a/lighthouse-core/lib/i18n/en-US.json +++ b/lighthouse-core/lib/i18n/en-US.json @@ -1095,6 +1095,10 @@ "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 immediately under the SEO title element. 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 above the manual checks section of the SEO category. No character length limits." + }, "lighthouse-core/config/default-config.js | seoCategoryTitle": { "message": "SEO", "description": "Title of the Search Engine Optimization (SEO) category of audits. Used commonly as the acronym SEO, this term includes all 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." diff --git a/lighthouse-core/test/results/sample_v2.json b/lighthouse-core/test/results/sample_v2.json index c92af1a51263..c2fdcacf6a42 100644 --- a/lighthouse-core/test/results/sample_v2.json +++ b/lighthouse-core/test/results/sample_v2.json @@ -5068,6 +5068,9 @@ "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" ], From 057090043f63c775db3f1d50d6b425de2638fa0b Mon Sep 17 00:00:00 2001 From: Shane Exterkamp Date: Wed, 30 Jan 2019 16:45:10 -0800 Subject: [PATCH 09/27] updated descriptions. --- lighthouse-core/config/default-config.js | 6 +++--- lighthouse-core/lib/i18n/en-US.json | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lighthouse-core/config/default-config.js b/lighthouse-core/config/default-config.js index 8c6bb97803d5..8f4967bef78f 100644 --- a/lighthouse-core/config/default-config.js +++ b/lighthouse-core/config/default-config.js @@ -63,13 +63,13 @@ 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. Used commonly as the acronym SEO, this term includes all 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. */ + /** 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 immediately under the SEO title element. No character length limits. 'Learn More' becomes link text to additional documentation. */ + /** 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 above the manual checks section of the SEO category. No character length limits. */ + /** 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', diff --git a/lighthouse-core/lib/i18n/en-US.json b/lighthouse-core/lib/i18n/en-US.json index b366d7f70f31..d1e8f4453838 100644 --- a/lighthouse-core/lib/i18n/en-US.json +++ b/lighthouse-core/lib/i18n/en-US.json @@ -1093,15 +1093,15 @@ }, "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 immediately under the SEO title element. No character length limits. 'Learn More' becomes link text to additional documentation." + "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 above the manual checks section of the SEO category. No character length limits." + "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. Used commonly as the acronym SEO, this term includes all 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." + "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", From 7f47810dccc173066687984581d71d07bdeebac4 Mon Sep 17 00:00:00 2001 From: Shane Exterkamp Date: Tue, 5 Feb 2019 14:00:16 -0800 Subject: [PATCH 10/27] Adjusted text based on feedback. --- lighthouse-core/audits/seo/canonical.js | 2 +- lighthouse-core/audits/seo/font-size.js | 2 +- lighthouse-core/audits/seo/hreflang.js | 2 +- lighthouse-core/audits/seo/http-status-code.js | 2 +- lighthouse-core/audits/seo/is-crawlable.js | 2 +- lighthouse-core/audits/seo/link-text.js | 2 +- lighthouse-core/audits/seo/manual/mobile-friendly.js | 2 +- lighthouse-core/audits/seo/manual/structured-data.js | 2 +- lighthouse-core/audits/seo/meta-description.js | 2 +- lighthouse-core/audits/seo/plugins.js | 2 +- lighthouse-core/audits/seo/robots-txt.js | 4 ++-- 11 files changed, 12 insertions(+), 12 deletions(-) diff --git a/lighthouse-core/audits/seo/canonical.js b/lighthouse-core/audits/seo/canonical.js index c14ac720e8c4..b95c28efad9c 100644 --- a/lighthouse-core/audits/seo/canonical.js +++ b/lighthouse-core/audits/seo/canonical.js @@ -15,7 +15,7 @@ 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. */ title: 'Document has a valid `rel=canonical`', - /** Title of a Lighthouse audit that provides detail on a page's rel=canonical link. This imperative title is shown to users when the rel=canonical link is invalid and should be fixed. */ + /** Descriptive title of a Lighthouse audit that provides detail on a page's rel=canonical link. This imperative title is shown to users when the rel=canonical link is invalid and should be fixed. */ 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. ' + diff --git a/lighthouse-core/audits/seo/font-size.js b/lighthouse-core/audits/seo/font-size.js index 3d2e3b532376..6a328a2bc656 100644 --- a/lighthouse-core/audits/seo/font-size.js +++ b/lighthouse-core/audits/seo/font-size.js @@ -16,7 +16,7 @@ const MINIMAL_PERCENTAGE_OF_LEGIBLE_TEXT = 60; const UIStrings = { /** 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', - /** Title of a Lighthouse audit that provides detail on the font sizes used on the page. This imperative title is shown to users when there is a font that is too small to be read by the user. */ + /** Descriptive title of a Lighthouse audit that provides detail on the font sizes used on the page. This imperative title is shown to users when there is a font that is too small to be read by the user. */ 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).', diff --git a/lighthouse-core/audits/seo/hreflang.js b/lighthouse-core/audits/seo/hreflang.js index 7ea160b852e3..33c8fb39ba9d 100644 --- a/lighthouse-core/audits/seo/hreflang.js +++ b/lighthouse-core/audits/seo/hreflang.js @@ -16,7 +16,7 @@ const i18n = require('../../lib/i18n/i18n.js'); const UIStrings = { /** Title of a Lighthouse audit that provides detail on the `hreflang` element on a page. This descriptive title is shown when the `hreflang` element is configured correctly. */ title: 'Document has a valid `hreflang`', - /** Title of a Lighthouse audit that provides detail on the `hreflang` element on a page. This imperative title is shown when the `hreflang` element is not valid and needs to be fixed. */ + /** Descriptive title of a Lighthouse audit that provides detail on the `hreflang` element on a page. This imperative title is shown when the `hreflang` element is not valid and needs to be fixed. */ 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. */ description: 'hreflang links tell search engines what version of a page they should ' + diff --git a/lighthouse-core/audits/seo/http-status-code.js b/lighthouse-core/audits/seo/http-status-code.js index d90c88827d4c..aac70a4959c4 100644 --- a/lighthouse-core/audits/seo/http-status-code.js +++ b/lighthouse-core/audits/seo/http-status-code.js @@ -14,7 +14,7 @@ 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', - /** Title of a Lighthouse audit that provides detail on the HTTP status code a page responds with. This imperative title is shown when the page responds to requests with an HTTP status code that indicates the request was unsuccessful. */ + /** Descriptive title of a Lighthouse audit that provides detail on the HTTP status code a page responds with. This imperative 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. ' + diff --git a/lighthouse-core/audits/seo/is-crawlable.js b/lighthouse-core/audits/seo/is-crawlable.js index 8cae22ad764b..c44de2dac7d2 100644 --- a/lighthouse-core/audits/seo/is-crawlable.js +++ b/lighthouse-core/audits/seo/is-crawlable.js @@ -20,7 +20,7 @@ const i18n = require('../../lib/i18n/i18n.js'); const UIStrings = { /** Title of a Lighthouse audit that provides detail on the blocking status of their page in regards to search-engine index crawling. This descriptive 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 the blocking status of their page in regards to search-engine index crawling. This imperative title is shown when the page has been configured to block indexing and therefore cannot be indexed by search engines. */ + /** Descriptive title of a Lighthouse audit that provides detail on the blocking status of their page in regards to search-engine index crawling. This imperative 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* they need to allow crawling 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: 'Search engines are unable to include your pages in search results ' + diff --git a/lighthouse-core/audits/seo/link-text.js b/lighthouse-core/audits/seo/link-text.js index c4a7c8f2697d..6ec0de18305f 100644 --- a/lighthouse-core/audits/seo/link-text.js +++ b/lighthouse-core/audits/seo/link-text.js @@ -23,7 +23,7 @@ const i18n = require('../../lib/i18n/i18n.js'); const UIStrings = { /** Title of a Lighthouse audit that provides detail on the text descriptions used for links on the page. 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 provides detail on the text descriptions used for links on the page. This imperative title is shown when one or more links on the page do not have enough text describing them to be considered valid when being crawled by a search engine. */ + /** Descriptive title of a Lighthouse audit that provides detail on the text descriptions used for links on the page, this is shown when links contain generic non-descriptive text like "click here". This imperative title is shown when one or more links on the page do not have enough text describing them to be considered valid when being crawled by a search engine. */ 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. ' + diff --git a/lighthouse-core/audits/seo/manual/mobile-friendly.js b/lighthouse-core/audits/seo/manual/mobile-friendly.js index 6c4e61035d85..4cf0ede164d8 100644 --- a/lighthouse-core/audits/seo/manual/mobile-friendly.js +++ b/lighthouse-core/audits/seo/manual/mobile-friendly.js @@ -11,7 +11,7 @@ const i18n = require('../../../lib/i18n/i18n.js'); const UIStrings = { /** Description of a Lighthouse audit that provides detail on how well the page is setup to be compatible with mobile devices such as cellphones. 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: 'Take the [Mobile-Friendly Test](https://search.google.com/test/mobile-friendly) to check for audits not covered by Lighthouse, like sizing tap targets appropriately. [Learn more](https://developers.google.com/search/mobile-sites/).', - /** Title of a Lighthouse audit that provides detail on how well the page is setup to be compatible with mobile devices such as cellphones. This is displayed in a list of audit titles that Lighthouse generates. */ + /** Title of a Lighthouse audit that prompts users to manually check their page for compatibility with mobile devices such as cellphones. This is displayed in a list of audit titles that Lighthouse generates. */ title: 'Page is mobile friendly', }; diff --git a/lighthouse-core/audits/seo/manual/structured-data.js b/lighthouse-core/audits/seo/manual/structured-data.js index b6c419d97c1f..5d7bb2822583 100644 --- a/lighthouse-core/audits/seo/manual/structured-data.js +++ b/lighthouse-core/audits/seo/manual/structured-data.js @@ -11,7 +11,7 @@ const i18n = require('../../../lib/i18n/i18n.js'); const UIStrings = { /** Description of a Lighthouse audit that provides detail on the structured data in a 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: '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 provides detail on the structured data in a page. This is displayed in a list of audit titles that Lighthouse generates. */ + /** Title of a Lighthouse audit that prompts users to manually check their page for valid structured data. This is displayed in a list of audit titles that Lighthouse generates. */ title: 'Structured data is valid', }; diff --git a/lighthouse-core/audits/seo/meta-description.js b/lighthouse-core/audits/seo/meta-description.js index c562578f09bb..aaccd3643632 100644 --- a/lighthouse-core/audits/seo/meta-description.js +++ b/lighthouse-core/audits/seo/meta-description.js @@ -11,7 +11,7 @@ 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. */ title: 'Document has a meta description', - /** Title of a Lighthouse audit that provides detail on the web page's document meta description. This imperative title is shown when the document does not have a meta description. */ + /** Descriptive title of a Lighthouse audit that provides detail on the web page's document meta description. This imperative title is shown when the document does not have a meta description. */ 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 ' + diff --git a/lighthouse-core/audits/seo/plugins.js b/lighthouse-core/audits/seo/plugins.js index 8d34400bd5ae..6fe9dd5e3be6 100644 --- a/lighthouse-core/audits/seo/plugins.js +++ b/lighthouse-core/audits/seo/plugins.js @@ -36,7 +36,7 @@ const i18n = require('../../lib/i18n/i18n.js'); const UIStrings = { /** Title of a Lighthouse audit that provides detail on the plugin content found in 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', - /** Title of a Lighthouse audit that provides detail on the plugin content found in the page. This imperative title is shown when there is plugin content on the page which cannot be indexed by search engine crawlers. */ + /** Descriptive title of a Lighthouse audit that provides detail on the plugin content found in the page. This imperative title is shown when there is plugin content on the page which cannot be indexed by search engine crawlers. */ failureTitle: 'Document uses plugins', /** Description of a Lighthouse audit that tells the user *why* they need to avoid using plugin 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 ' + diff --git a/lighthouse-core/audits/seo/robots-txt.js b/lighthouse-core/audits/seo/robots-txt.js index 9ea04bb46cf0..118211f29f5b 100644 --- a/lighthouse-core/audits/seo/robots-txt.js +++ b/lighthouse-core/audits/seo/robots-txt.js @@ -36,7 +36,7 @@ const i18n = require('../../lib/i18n/i18n.js'); const UIStrings = { /** Title of a Lighthouse audit that provides detail on the robots.txt file on the page. 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 robots.txt file on the page. This imperative title is shown when the robots.txt file is misconfigured, which makes the page hard or impossible to scan via web crawler. */ + /** Descriptive title of a Lighthouse audit that provides detail on the robots.txt file on the page. This imperative 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. 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: 'If your robots.txt file is malformed, crawlers may not be able to understand ' + @@ -49,7 +49,7 @@ const UIStrings = { 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 page.*/ - explanation: 'Lighthouse was unable to download your robots.txt file', + explanation: 'Lighthouse was unable to download a robots.txt file', }; const str_ = i18n.createMessageInstanceIdFn(__filename, UIStrings); From 5b77efe514e674602e3118b68ab67c3a69e3ce88 Mon Sep 17 00:00:00 2001 From: Shane Exterkamp Date: Tue, 5 Feb 2019 14:03:18 -0800 Subject: [PATCH 11/27] updated translations. --- lighthouse-core/lib/i18n/en-US.json | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/lighthouse-core/lib/i18n/en-US.json b/lighthouse-core/lib/i18n/en-US.json index ff1bb001e70b..b285722c33a3 100644 --- a/lighthouse-core/lib/i18n/en-US.json +++ b/lighthouse-core/lib/i18n/en-US.json @@ -761,7 +761,7 @@ }, "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 imperative title is shown to users when the rel=canonical link is invalid and should be fixed." + "description": "Descriptive title of a Lighthouse audit that provides detail on a page's rel=canonical link. This imperative title is shown to users when the rel=canonical link is invalid and should be fixed." }, "lighthouse-core/audits/seo/canonical.js | title": { "message": "Document has a valid `rel=canonical`", @@ -789,7 +789,7 @@ }, "lighthouse-core/audits/seo/font-size.js | failureTitle": { "message": "Document doesn't use legible font sizes", - "description": "Title of a Lighthouse audit that provides detail on the font sizes used on the page. This imperative title is shown to users when there is a font that is too small to be read by the user." + "description": "Descriptive title of a Lighthouse audit that provides detail on the font sizes used on the page. This imperative title is shown to users when there is a font that is too small to be read by the user." }, "lighthouse-core/audits/seo/font-size.js | title": { "message": "Document uses legible font sizes", @@ -801,7 +801,7 @@ }, "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` element on a page. This imperative title is shown when the `hreflang` element is not valid and needs to be fixed." + "description": "Descriptive title of a Lighthouse audit that provides detail on the `hreflang` element on a page. This imperative title is shown when the `hreflang` element is not valid and needs to be fixed." }, "lighthouse-core/audits/seo/hreflang.js | title": { "message": "Document has a valid `hreflang`", @@ -813,7 +813,7 @@ }, "lighthouse-core/audits/seo/http-status-code.js | failureTitle": { "message": "Page has unsuccessful HTTP status code", - "description": "Title of a Lighthouse audit that provides detail on the HTTP status code a page responds with. This imperative title is shown when the page responds to requests with an HTTP status code that indicates the request was unsuccessful." + "description": "Descriptive title of a Lighthouse audit that provides detail on the HTTP status code a page responds with. This imperative 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", @@ -825,7 +825,7 @@ }, "lighthouse-core/audits/seo/is-crawlable.js | failureTitle": { "message": "Page is blocked from indexing", - "description": "Title of a Lighthouse audit that provides detail on the blocking status of their page in regards to search-engine index crawling. This imperative title is shown when the page has been configured to block indexing and therefore cannot be indexed by search engines." + "description": "Descriptive title of a Lighthouse audit that provides detail on the blocking status of their page in regards to search-engine index crawling. This imperative 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", @@ -841,7 +841,7 @@ }, "lighthouse-core/audits/seo/link-text.js | failureTitle": { "message": "Links do not have descriptive text", - "description": "Title of a Lighthouse audit that provides detail on the text descriptions used for links on the page. This imperative title is shown when one or more links on the page do not have enough text describing them to be considered valid when being crawled by a search engine." + "description": "Descriptive title of a Lighthouse audit that provides detail on the text descriptions used for links on the page, this is shown when links contain generic non-descriptive text like \"click here\". This imperative title is shown when one or more links on the page do not have enough text describing them to be considered valid when being crawled by a search engine." }, "lighthouse-core/audits/seo/link-text.js | title": { "message": "Links have descriptive text", @@ -853,7 +853,7 @@ }, "lighthouse-core/audits/seo/manual/mobile-friendly.js | title": { "message": "Page is mobile friendly", - "description": "Title of a Lighthouse audit that provides detail on how well the page is setup to be compatible with mobile devices such as cellphones. This is displayed in a list of audit titles that Lighthouse generates." + "description": "Title of a Lighthouse audit that prompts users to manually check their page for compatibility with mobile devices such as cellphones. This is displayed in a list of audit titles that Lighthouse generates." }, "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).", @@ -861,7 +861,7 @@ }, "lighthouse-core/audits/seo/manual/structured-data.js | title": { "message": "Structured data is valid", - "description": "Title of a Lighthouse audit that provides detail on the structured data in a page. This is displayed in a list of audit titles that Lighthouse generates." + "description": "Title of a Lighthouse audit that prompts users to manually check their page for valid structured data. This is displayed in a list of audit titles that Lighthouse generates." }, "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).", @@ -873,7 +873,7 @@ }, "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 imperative title is shown when the document does not have a meta description." + "description": "Descriptive title of a Lighthouse audit that provides detail on the web page's document meta description. This imperative title is shown when the document does not have a meta description." }, "lighthouse-core/audits/seo/meta-description.js | title": { "message": "Document has a meta description", @@ -885,7 +885,7 @@ }, "lighthouse-core/audits/seo/plugins.js | failureTitle": { "message": "Document uses plugins", - "description": "Title of a Lighthouse audit that provides detail on the plugin content found in the page. This imperative title is shown when there is plugin content on the page which cannot be indexed by search engine crawlers." + "description": "Descriptive title of a Lighthouse audit that provides detail on the plugin content found in the page. This imperative title is shown when there is plugin content on the page which cannot be indexed by search engine crawlers." }, "lighthouse-core/audits/seo/plugins.js | title": { "message": "Document avoids plugins", @@ -904,12 +904,12 @@ "description": "[ICU Syntax] Label for the audit identifying the number of errors that occured while validating the robots.txt file." }, "lighthouse-core/audits/seo/robots-txt.js | explanation": { - "message": "Lighthouse was unable to download your robots.txt file", + "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 page." }, "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 robots.txt file on the page. This imperative title is shown when the robots.txt file is misconfigured, which makes the page hard or impossible to scan via web crawler." + "description": "Descriptive title of a Lighthouse audit that provides detail on the robots.txt file on the page. This imperative 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", From b839a63adca0d8fd7ecabf928d1246dda8cf2c6a Mon Sep 17 00:00:00 2001 From: Shane Exterkamp Date: Tue, 5 Feb 2019 14:06:07 -0800 Subject: [PATCH 12/27] change for consistency to failureTitle. --- lighthouse-core/audits/seo/tap-targets.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lighthouse-core/audits/seo/tap-targets.js b/lighthouse-core/audits/seo/tap-targets.js index b82e51fdb8bf..3044fbee565c 100644 --- a/lighthouse-core/audits/seo/tap-targets.js +++ b/lighthouse-core/audits/seo/tap-targets.js @@ -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).', From 0f23deec439cd2c1fe9a16a3254b183c72e99aff Mon Sep 17 00:00:00 2001 From: Shane Exterkamp Date: Tue, 5 Feb 2019 14:45:20 -0800 Subject: [PATCH 13/27] Forgot to update that last description in en-US. --- lighthouse-core/lib/i18n/en-US.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lighthouse-core/lib/i18n/en-US.json b/lighthouse-core/lib/i18n/en-US.json index 520cd5b40825..1d140a7cd652 100644 --- a/lighthouse-core/lib/i18n/en-US.json +++ b/lighthouse-core/lib/i18n/en-US.json @@ -945,7 +945,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", From feea7c3e4601b8e885349518030b1d9d7fc1f911 Mon Sep 17 00:00:00 2001 From: Shane Exterkamp Date: Tue, 12 Feb 2019 11:14:50 -0800 Subject: [PATCH 14/27] Brendan feedback for robots.txt --- lighthouse-core/audits/seo/robots-txt.js | 12 ++++++------ lighthouse-core/lib/i18n/en-US.json | 12 ++++++------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/lighthouse-core/audits/seo/robots-txt.js b/lighthouse-core/audits/seo/robots-txt.js index ad001d177f0e..817701037f05 100644 --- a/lighthouse-core/audits/seo/robots-txt.js +++ b/lighthouse-core/audits/seo/robots-txt.js @@ -34,21 +34,21 @@ 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 robots.txt file on the page. This descriptive title is shown when the robots.txt file is present and configured correctly. */ + /** 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', - /** Descriptive title of a Lighthouse audit that provides detail on the robots.txt file on the page. This imperative title is shown when the robots.txt file is misconfigured, which makes the page hard or impossible to scan via web crawler. */ + /** Descriptive 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 imperative 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. 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 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. */ + /** [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. */ displayValueHttpError: '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. */ + /** [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 page.*/ + /** 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', }; diff --git a/lighthouse-core/lib/i18n/en-US.json b/lighthouse-core/lib/i18n/en-US.json index 1d140a7cd652..a6a6d7c8da28 100644 --- a/lighthouse-core/lib/i18n/en-US.json +++ b/lighthouse-core/lib/i18n/en-US.json @@ -909,27 +909,27 @@ }, "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. 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": "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 | displayValueHttpError": { "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." + "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." + "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 page." + "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": "Descriptive title of a Lighthouse audit that provides detail on the robots.txt file on the page. This imperative title is shown when the robots.txt file is misconfigured, which makes the page hard or impossible to scan via web crawler." + "description": "Descriptive 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 imperative 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 robots.txt file on the page. This descriptive title is shown when the robots.txt file is present and configured correctly." + "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).", From 93a99bf6fbcd257faa4b4459e9dc138667b043e1 Mon Sep 17 00:00:00 2001 From: Shane Exterkamp Date: Tue, 12 Feb 2019 11:18:54 -0800 Subject: [PATCH 15/27] Brendan feedback on plugins. --- lighthouse-core/audits/seo/plugins.js | 6 +++--- lighthouse-core/lib/i18n/en-US.json | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lighthouse-core/audits/seo/plugins.js b/lighthouse-core/audits/seo/plugins.js index 5c64de109e1d..2052941f8191 100644 --- a/lighthouse-core/audits/seo/plugins.js +++ b/lighthouse-core/audits/seo/plugins.js @@ -34,11 +34,11 @@ const SOURCE_PARAMS = new Set([ const i18n = require('../../lib/i18n/i18n.js'); const UIStrings = { - /** Title of a Lighthouse audit that provides detail on the plugin content found in the page. This descriptive title is shown when there is no plugin content on the page that would restrict search indexing. */ + /** 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 plugin content found in the page. This imperative title is shown when there is plugin content on the page which cannot be indexed by search engine crawlers. */ + /** 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 plugin 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 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).', diff --git a/lighthouse-core/lib/i18n/en-US.json b/lighthouse-core/lib/i18n/en-US.json index a6a6d7c8da28..58be9824905d 100644 --- a/lighthouse-core/lib/i18n/en-US.json +++ b/lighthouse-core/lib/i18n/en-US.json @@ -897,15 +897,15 @@ }, "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 plugin 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": "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 plugin content found in the page. This imperative title is shown when there is plugin content on the page which cannot be indexed by search engine crawlers." + "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 plugin content found in the page. This descriptive title is shown when there is no plugin content on the page that would restrict search indexing." + "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.", From 7b3fcb5ca9aa4b33edb1a908e11023aca1e8a3b3 Mon Sep 17 00:00:00 2001 From: Shane Exterkamp Date: Tue, 12 Feb 2019 11:24:39 -0800 Subject: [PATCH 16/27] Brendan feedback for meta-desc, and manual seo audits. --- lighthouse-core/audits/seo/manual/mobile-friendly.js | 4 ++-- lighthouse-core/audits/seo/manual/structured-data.js | 4 ++-- lighthouse-core/audits/seo/meta-description.js | 4 ++-- lighthouse-core/lib/i18n/en-US.json | 12 ++++++------ 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/lighthouse-core/audits/seo/manual/mobile-friendly.js b/lighthouse-core/audits/seo/manual/mobile-friendly.js index 4cf0ede164d8..70e86098d64d 100644 --- a/lighthouse-core/audits/seo/manual/mobile-friendly.js +++ b/lighthouse-core/audits/seo/manual/mobile-friendly.js @@ -9,9 +9,9 @@ const ManualAudit = require('../../manual/manual-audit'); const i18n = require('../../../lib/i18n/i18n.js'); const UIStrings = { - /** Description of a Lighthouse audit that provides detail on how well the page is setup to be compatible with mobile devices such as cellphones. 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 that prompts the user to take additional steps to test how compatible the page is with mobile devices such as cellphones. 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: 'Take the [Mobile-Friendly Test](https://search.google.com/test/mobile-friendly) to check for audits not covered by Lighthouse, like sizing tap targets appropriately. [Learn more](https://developers.google.com/search/mobile-sites/).', - /** Title of a Lighthouse audit that prompts users to manually check their page for compatibility with mobile devices such as cellphones. This is displayed in a list of audit titles that Lighthouse generates. */ + /** Title of a Lighthouse audit that prompts users to manually check their page for compatibility with mobile devices such as cellphones. */ title: 'Page is mobile friendly', }; diff --git a/lighthouse-core/audits/seo/manual/structured-data.js b/lighthouse-core/audits/seo/manual/structured-data.js index 5d7bb2822583..fbeaf8db3bae 100644 --- a/lighthouse-core/audits/seo/manual/structured-data.js +++ b/lighthouse-core/audits/seo/manual/structured-data.js @@ -9,9 +9,9 @@ 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. 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 of a Lighthouse audit that provides detail on the structured data in a page. Structured data is standardized data on a page that helps a search engine categorize and understand its contents. 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: '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. This is displayed in a list of audit titles that Lighthouse generates. */ + /** Title of a Lighthouse audit that prompts users to manually check their page for valid structured data. */ title: 'Structured data is valid', }; diff --git a/lighthouse-core/audits/seo/meta-description.js b/lighthouse-core/audits/seo/meta-description.js index aaccd3643632..5aa72b0571cf 100644 --- a/lighthouse-core/audits/seo/meta-description.js +++ b/lighthouse-core/audits/seo/meta-description.js @@ -9,9 +9,9 @@ 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. */ + /** 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', - /** Descriptive title of a Lighthouse audit that provides detail on the web page's document meta description. This imperative title is shown when the document does not have 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 ' + diff --git a/lighthouse-core/lib/i18n/en-US.json b/lighthouse-core/lib/i18n/en-US.json index 58be9824905d..3619bd108635 100644 --- a/lighthouse-core/lib/i18n/en-US.json +++ b/lighthouse-core/lib/i18n/en-US.json @@ -865,19 +865,19 @@ }, "lighthouse-core/audits/seo/manual/mobile-friendly.js | description": { "message": "Take the [Mobile-Friendly Test](https://search.google.com/test/mobile-friendly) to check for audits not covered by Lighthouse, like sizing tap targets appropriately. [Learn more](https://developers.google.com/search/mobile-sites/).", - "description": "Description of a Lighthouse audit that provides detail on how well the page is setup to be compatible with mobile devices such as cellphones. 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": "Description that prompts the user to take additional steps to test how compatible the page is with mobile devices such as cellphones. 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/manual/mobile-friendly.js | title": { "message": "Page is mobile friendly", - "description": "Title of a Lighthouse audit that prompts users to manually check their page for compatibility with mobile devices such as cellphones. This is displayed in a list of audit titles that Lighthouse generates." + "description": "Title of a Lighthouse audit that prompts users to manually check their page for compatibility with mobile devices such as cellphones." }, "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. 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": "Description of a Lighthouse audit that provides detail on the structured data in a page. Structured data is standardized data on a page that helps a search engine categorize and understand its contents. 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/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. This is displayed in a list of audit titles that Lighthouse generates." + "description": "Title of a Lighthouse audit that prompts users to manually check their page for valid structured data." }, "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).", @@ -889,11 +889,11 @@ }, "lighthouse-core/audits/seo/meta-description.js | failureTitle": { "message": "Document does not have a meta description", - "description": "Descriptive title of a Lighthouse audit that provides detail on the web page's document meta description. This imperative title is shown when the 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." + "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).", From aa9bb0b16a9298c08208fa37696a1bc3bd4e89de Mon Sep 17 00:00:00 2001 From: Shane Exterkamp Date: Tue, 12 Feb 2019 11:29:41 -0800 Subject: [PATCH 17/27] Brendan feedback for is crawlable and link text. --- lighthouse-core/audits/seo/is-crawlable.js | 6 +++--- lighthouse-core/audits/seo/link-text.js | 6 +++--- lighthouse-core/lib/i18n/en-US.json | 12 ++++++------ 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/lighthouse-core/audits/seo/is-crawlable.js b/lighthouse-core/audits/seo/is-crawlable.js index dd1dd5458847..4f5ea1f08a1b 100644 --- a/lighthouse-core/audits/seo/is-crawlable.js +++ b/lighthouse-core/audits/seo/is-crawlable.js @@ -18,11 +18,11 @@ const UNAVAILABLE_AFTER = 'unavailable_after'; const i18n = require('../../lib/i18n/i18n.js'); const UIStrings = { - /** Title of a Lighthouse audit that provides detail on the blocking status of their page in regards to search-engine index crawling. This descriptive title is shown when the page is not blocked from indexing and can be crawled. */ + /** 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', - /** Descriptive title of a Lighthouse audit that provides detail on the blocking status of their page in regards to search-engine index crawling. This imperative title is shown when the page has been configured to block indexing and therefore cannot be indexed by search engines. */ + /** 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* they need to allow crawling 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 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).', diff --git a/lighthouse-core/audits/seo/link-text.js b/lighthouse-core/audits/seo/link-text.js index 380e2a3f5b8f..567917f5343a 100644 --- a/lighthouse-core/audits/seo/link-text.js +++ b/lighthouse-core/audits/seo/link-text.js @@ -21,14 +21,14 @@ const BLOCKLIST = new Set([ const i18n = require('../../lib/i18n/i18n.js'); const UIStrings = { - /** Title of a Lighthouse audit that provides detail on the text descriptions used for links on the page. This descriptive title is shown when all links on the page have sufficient textual descriptions. */ + /** 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', - /** Descriptive title of a Lighthouse audit that provides detail on the text descriptions used for links on the page, this is shown when links contain generic non-descriptive text like "click here". This imperative title is shown when one or more links on the page do not have enough text describing them to be considered valid when being crawled by a search engine. */ + /** 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 do not have enough text describing them to be considered valid when being crawled by a search engine. */ 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. */ + /** [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} diff --git a/lighthouse-core/lib/i18n/en-US.json b/lighthouse-core/lib/i18n/en-US.json index 3619bd108635..1e8c938a31bb 100644 --- a/lighthouse-core/lib/i18n/en-US.json +++ b/lighthouse-core/lib/i18n/en-US.json @@ -837,15 +837,15 @@ }, "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* they need to allow crawling 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": "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": "Descriptive title of a Lighthouse audit that provides detail on the blocking status of their page in regards to search-engine index crawling. This imperative title is shown when the page has been configured to block indexing and therefore cannot be indexed by search engines." + "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 the blocking status of their page in regards to search-engine index crawling. This descriptive title is shown when the page is not blocked from indexing and can be crawled." + "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).", @@ -853,15 +853,15 @@ }, "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." + "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": "Descriptive title of a Lighthouse audit that provides detail on the text descriptions used for links on the page, this is shown when links contain generic non-descriptive text like \"click here\". This imperative title is shown when one or more links on the page do not have enough text describing them to be considered valid when being crawled by a search engine." + "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 do not have enough text describing them to be considered valid when being crawled by a search engine." }, "lighthouse-core/audits/seo/link-text.js | title": { "message": "Links have descriptive text", - "description": "Title of a Lighthouse audit that provides detail on the text descriptions used for links on the page. This descriptive title is shown when all links on the page have sufficient textual descriptions." + "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/mobile-friendly.js | description": { "message": "Take the [Mobile-Friendly Test](https://search.google.com/test/mobile-friendly) to check for audits not covered by Lighthouse, like sizing tap targets appropriately. [Learn more](https://developers.google.com/search/mobile-sites/).", From 62564d5d0794ff396c6988f678b7973714046a61 Mon Sep 17 00:00:00 2001 From: Shane Exterkamp Date: Tue, 12 Feb 2019 11:56:47 -0800 Subject: [PATCH 18/27] Brendan feedback for hreflang, canonical, http status code --- lighthouse-core/audits/seo/canonical.js | 20 +++++++------- lighthouse-core/audits/seo/hreflang.js | 6 ++--- .../audits/seo/http-status-code.js | 2 +- lighthouse-core/lib/i18n/en-US.json | 26 +++++++++---------- 4 files changed, 27 insertions(+), 27 deletions(-) diff --git a/lighthouse-core/audits/seo/canonical.js b/lighthouse-core/audits/seo/canonical.js index b95c28efad9c..70aa4ce22ad2 100644 --- a/lighthouse-core/audits/seo/canonical.js +++ b/lighthouse-core/audits/seo/canonical.js @@ -13,24 +13,24 @@ 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. */ + /** 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`', - /** Descriptive title of a Lighthouse audit that provides detail on a page's rel=canonical link. This imperative title is shown to users when the rel=canonical link is invalid and should be fixed. */ + /** 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. */ + /** [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. */ + /** [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. */ + /** [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. */ - explanationPointsElsewhere: 'Points to another hreflang location ({href})', - /** [ICU Syntax] Explanatory message stating that there was a failure in an audit caused by a URL pointing to a different domain. */ + /** [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 a root of the same origin which is a common mistake. The canonical URL should point a different page with the same content whose URL is preferred, not a parent or root page. */ + /** Explanatory message stating that the page's canonical URL was pointing to a 'root of the same origin' which is a common mistake. The canonical URL should point a different page with the same content whose URL is preferred; however, in this case the canonical URL points to the root page (which is of the same origin) i.e. http://example.com/post1?alt=true -points to-> http://example.com/ when it should point to something like http://example.com/post1. In this context "root" is the starting page of a website, and "origin" is the domain the website is registered under. */ explanationRoot: 'Points to a root of the same origin', }; @@ -169,7 +169,7 @@ class Canonical extends Audit { baseURL.href !== canonicalURL.href) { return { rawValue: false, - explanation: str_(UIStrings.explanationPointsElsewhere, {href: baseURL.href}), + explanation: str_(UIStrings.explanationPointsElsewhere, {url: baseURL.href}), }; } diff --git a/lighthouse-core/audits/seo/hreflang.js b/lighthouse-core/audits/seo/hreflang.js index 2f390c0fdbf5..851fa14520c0 100644 --- a/lighthouse-core/audits/seo/hreflang.js +++ b/lighthouse-core/audits/seo/hreflang.js @@ -14,11 +14,11 @@ 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` element on a page. This descriptive title is shown when the `hreflang` element is configured correctly. */ + /** 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`', - /** Descriptive title of a Lighthouse audit that provides detail on the `hreflang` element on a page. This imperative title is shown when the `hreflang` element is not valid and needs to be fixed. */ + /** 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. */ + /** 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).', diff --git a/lighthouse-core/audits/seo/http-status-code.js b/lighthouse-core/audits/seo/http-status-code.js index aac70a4959c4..0cbb4b4e3d44 100644 --- a/lighthouse-core/audits/seo/http-status-code.js +++ b/lighthouse-core/audits/seo/http-status-code.js @@ -14,7 +14,7 @@ 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 imperative title is shown when the page responds to requests with an HTTP status code that indicates the request was unsuccessful. */ + /** 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. ' + diff --git a/lighthouse-core/lib/i18n/en-US.json b/lighthouse-core/lib/i18n/en-US.json index 1e8c938a31bb..76c7e3d577ec 100644 --- a/lighthouse-core/lib/i18n/en-US.json +++ b/lighthouse-core/lib/i18n/en-US.json @@ -753,35 +753,35 @@ }, "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." + "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." + "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." + "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 ({href})", - "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." + "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." + "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 a root of the same origin", - "description": "Explanatory message stating that the page's canonical URL was pointing to a root of the same origin which is a common mistake. The canonical URL should point a different page with the same content whose URL is preferred, not a parent or root page." + "description": "Explanatory message stating that the page's canonical URL was pointing to a 'root of the same origin' which is a common mistake. The canonical URL should point a different page with the same content whose URL is preferred; however, in this case the canonical URL points to the root page (which is of the same origin) i.e. http://example.com/post1?alt=true -points to-> http://example.com/ when it should point to something like http://example.com/post1. In this context \"root\" is the starting page of a website, and \"origin\" is the domain the website is registered under." }, "lighthouse-core/audits/seo/canonical.js | failureTitle": { "message": "Document does not have a valid `rel=canonical`", - "description": "Descriptive title of a Lighthouse audit that provides detail on a page's rel=canonical link. This imperative title is shown to users when the rel=canonical link is invalid and should be fixed." + "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." + "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).", @@ -813,15 +813,15 @@ }, "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." + "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": "Descriptive title of a Lighthouse audit that provides detail on the `hreflang` element on a page. This imperative title is shown when the `hreflang` element is not valid and needs to be fixed." + "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` element on a page. This descriptive title is shown when the `hreflang` element is configured correctly." + "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).", @@ -829,7 +829,7 @@ }, "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 imperative title is shown when the page responds to requests with an HTTP status code that indicates the request was unsuccessful." + "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", From 6dfbd5c4a947c051a82c58d17a5ed0f4d222fd2d Mon Sep 17 00:00:00 2001 From: Shane Exterkamp Date: Tue, 12 Feb 2019 13:10:31 -0800 Subject: [PATCH 19/27] Added ticks to hreflang --- lighthouse-core/audits/seo/canonical.js | 2 +- lighthouse-core/lib/i18n/en-US.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lighthouse-core/audits/seo/canonical.js b/lighthouse-core/audits/seo/canonical.js index 70aa4ce22ad2..714ec0176551 100644 --- a/lighthouse-core/audits/seo/canonical.js +++ b/lighthouse-core/audits/seo/canonical.js @@ -27,7 +27,7 @@ const UIStrings = { /** [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})', + 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 a 'root of the same origin' which is a common mistake. The canonical URL should point a different page with the same content whose URL is preferred; however, in this case the canonical URL points to the root page (which is of the same origin) i.e. http://example.com/post1?alt=true -points to-> http://example.com/ when it should point to something like http://example.com/post1. In this context "root" is the starting page of a website, and "origin" is the domain the website is registered under. */ diff --git a/lighthouse-core/lib/i18n/en-US.json b/lighthouse-core/lib/i18n/en-US.json index 76c7e3d577ec..0fbc324035e6 100644 --- a/lighthouse-core/lib/i18n/en-US.json +++ b/lighthouse-core/lib/i18n/en-US.json @@ -764,7 +764,7 @@ "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})", + "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": { From 18a75eee53d78384e3d265632c88c91863e6a490 Mon Sep 17 00:00:00 2001 From: Shane Exterkamp Date: Tue, 12 Feb 2019 13:19:04 -0800 Subject: [PATCH 20/27] Brendan feedback font size and last part of robots. --- lighthouse-core/audits/seo/font-size.js | 8 ++++---- lighthouse-core/audits/seo/robots-txt.js | 2 +- lighthouse-core/lib/i18n/en-US.json | 10 +++++----- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/lighthouse-core/audits/seo/font-size.js b/lighthouse-core/audits/seo/font-size.js index 0b15bff5b082..f7529aa37557 100644 --- a/lighthouse-core/audits/seo/font-size.js +++ b/lighthouse-core/audits/seo/font-size.js @@ -16,18 +16,18 @@ const MINIMAL_PERCENTAGE_OF_LEGIBLE_TEXT = 60; const UIStrings = { /** 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', - /** Descriptive title of a Lighthouse audit that provides detail on the font sizes used on the page. 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. */ + /** 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. */ + /** 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. */ + /** 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).', }; diff --git a/lighthouse-core/audits/seo/robots-txt.js b/lighthouse-core/audits/seo/robots-txt.js index 817701037f05..75c20dbda877 100644 --- a/lighthouse-core/audits/seo/robots-txt.js +++ b/lighthouse-core/audits/seo/robots-txt.js @@ -36,7 +36,7 @@ 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', - /** Descriptive 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 imperative title is shown when the robots.txt file is misconfigured, which makes the page hard or impossible to scan via web crawler. */ + /** 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 ' + diff --git a/lighthouse-core/lib/i18n/en-US.json b/lighthouse-core/lib/i18n/en-US.json index 0fbc324035e6..3e79a7e37d1d 100644 --- a/lighthouse-core/lib/i18n/en-US.json +++ b/lighthouse-core/lib/i18n/en-US.json @@ -793,19 +793,19 @@ }, "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." + "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." + "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." + "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": "Descriptive title of a Lighthouse audit that provides detail on the font sizes used on the page. 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", @@ -925,7 +925,7 @@ }, "lighthouse-core/audits/seo/robots-txt.js | failureTitle": { "message": "robots.txt is not valid", - "description": "Descriptive 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 imperative title is shown when the robots.txt file is misconfigured, which makes the page hard or impossible to scan via web crawler." + "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", From 324db81654d715a8ea1f92d39600d79f217cadb6 Mon Sep 17 00:00:00 2001 From: Brendan Kenny Date: Tue, 12 Feb 2019 13:21:07 -0800 Subject: [PATCH 21/27] Update lighthouse-core/audits/seo/link-text.js Co-Authored-By: exterkamp --- lighthouse-core/audits/seo/link-text.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lighthouse-core/audits/seo/link-text.js b/lighthouse-core/audits/seo/link-text.js index 567917f5343a..3abd8a270f55 100644 --- a/lighthouse-core/audits/seo/link-text.js +++ b/lighthouse-core/audits/seo/link-text.js @@ -23,7 +23,7 @@ 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 do not have enough text describing them to be considered valid when being crawled by a search engine. */ + /** 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. ' + From 5926722cb7feee2e9c78662a9646b4210d8fe734 Mon Sep 17 00:00:00 2001 From: Brendan Kenny Date: Tue, 12 Feb 2019 13:21:34 -0800 Subject: [PATCH 22/27] Update lighthouse-core/audits/seo/manual/structured-data.js Co-Authored-By: exterkamp --- lighthouse-core/audits/seo/manual/structured-data.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lighthouse-core/audits/seo/manual/structured-data.js b/lighthouse-core/audits/seo/manual/structured-data.js index fbeaf8db3bae..82abb163d632 100644 --- a/lighthouse-core/audits/seo/manual/structured-data.js +++ b/lighthouse-core/audits/seo/manual/structured-data.js @@ -9,7 +9,7 @@ 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 standardized data on a page that helps a search engine categorize and understand its contents. 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 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. */ title: 'Structured data is valid', From 10cafea646f4faae6a5538c336146a7e666037aa Mon Sep 17 00:00:00 2001 From: Brendan Kenny Date: Tue, 12 Feb 2019 13:22:05 -0800 Subject: [PATCH 23/27] Update lighthouse-core/audits/seo/manual/structured-data.js Co-Authored-By: exterkamp --- lighthouse-core/audits/seo/manual/structured-data.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lighthouse-core/audits/seo/manual/structured-data.js b/lighthouse-core/audits/seo/manual/structured-data.js index 82abb163d632..042f1b5cbd78 100644 --- a/lighthouse-core/audits/seo/manual/structured-data.js +++ b/lighthouse-core/audits/seo/manual/structured-data.js @@ -11,7 +11,7 @@ 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. */ + /** 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', }; From 7294f93e9d2ac474179206dee9f660d398b327b1 Mon Sep 17 00:00:00 2001 From: Shane Exterkamp Date: Tue, 12 Feb 2019 13:33:16 -0800 Subject: [PATCH 24/27] Canonical fix maybe, and added suggestion changes to en-US. --- lighthouse-core/audits/seo/canonical.js | 2 +- lighthouse-core/lib/i18n/en-US.json | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lighthouse-core/audits/seo/canonical.js b/lighthouse-core/audits/seo/canonical.js index 714ec0176551..143d1d360ab1 100644 --- a/lighthouse-core/audits/seo/canonical.js +++ b/lighthouse-core/audits/seo/canonical.js @@ -30,7 +30,7 @@ const UIStrings = { 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 a 'root of the same origin' which is a common mistake. The canonical URL should point a different page with the same content whose URL is preferred; however, in this case the canonical URL points to the root page (which is of the same origin) i.e. http://example.com/post1?alt=true -points to-> http://example.com/ when it should point to something like http://example.com/post1. In this context "root" is the starting page of a website, and "origin" is the domain the website is registered under. */ + /** Explanatory message stating that the page's canonical URL was pointing to a 'root of the same origin' 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. "origin" refers to the domain that the website is under. So in this case, the 'rel=canonical's link is referencing a URL that is the homepage of the entire website. */ explanationRoot: 'Points to a root of the same origin', }; diff --git a/lighthouse-core/lib/i18n/en-US.json b/lighthouse-core/lib/i18n/en-US.json index 3e79a7e37d1d..cde66bbf669f 100644 --- a/lighthouse-core/lib/i18n/en-US.json +++ b/lighthouse-core/lib/i18n/en-US.json @@ -773,7 +773,7 @@ }, "lighthouse-core/audits/seo/canonical.js | explanationRoot": { "message": "Points to a root of the same origin", - "description": "Explanatory message stating that the page's canonical URL was pointing to a 'root of the same origin' which is a common mistake. The canonical URL should point a different page with the same content whose URL is preferred; however, in this case the canonical URL points to the root page (which is of the same origin) i.e. http://example.com/post1?alt=true -points to-> http://example.com/ when it should point to something like http://example.com/post1. In this context \"root\" is the starting page of a website, and \"origin\" is the domain the website is registered under." + "description": "Explanatory message stating that the page's canonical URL was pointing to a 'root of the same origin' 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. \"origin\" refers to the domain that the website is under. So in this case, the 'rel=canonical's link is referencing a URL that is the homepage of the entire website." }, "lighthouse-core/audits/seo/canonical.js | failureTitle": { "message": "Document does not have a valid `rel=canonical`", @@ -857,7 +857,7 @@ }, "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 do not have enough text describing them to be considered valid when being crawled by a search engine." + "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", @@ -873,11 +873,11 @@ }, "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 standardized data on a page that helps a search engine categorize and understand its contents. 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": "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." + "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).", From edea4fb2795103540592ebc81778947d62b1fd5a Mon Sep 17 00:00:00 2001 From: Shane Exterkamp Date: Tue, 12 Feb 2019 13:43:08 -0800 Subject: [PATCH 25/27] Feedback on canonical. --- lighthouse-core/audits/seo/canonical.js | 5 +++-- lighthouse-core/lib/i18n/en-US.json | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/lighthouse-core/audits/seo/canonical.js b/lighthouse-core/audits/seo/canonical.js index 143d1d360ab1..55063f262356 100644 --- a/lighthouse-core/audits/seo/canonical.js +++ b/lighthouse-core/audits/seo/canonical.js @@ -30,8 +30,9 @@ const UIStrings = { 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 a 'root of the same origin' 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. "origin" refers to the domain that the website is under. So in this case, the 'rel=canonical's link is referencing a URL that is the homepage of the entire website. */ - explanationRoot: 'Points to a root of the same origin', + /** 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); diff --git a/lighthouse-core/lib/i18n/en-US.json b/lighthouse-core/lib/i18n/en-US.json index cde66bbf669f..3560d6fe6d02 100644 --- a/lighthouse-core/lib/i18n/en-US.json +++ b/lighthouse-core/lib/i18n/en-US.json @@ -772,8 +772,8 @@ "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 a root of the same origin", - "description": "Explanatory message stating that the page's canonical URL was pointing to a 'root of the same origin' 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. \"origin\" refers to the domain that the website is under. So in this case, the 'rel=canonical's link is referencing a URL that is the homepage of the entire website." + "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`", From b122256a4ae73ceb4f77a95612b9b6e5419a0696 Mon Sep 17 00:00:00 2001 From: Shane Exterkamp Date: Tue, 12 Feb 2019 14:16:09 -0800 Subject: [PATCH 26/27] removed toFixed(2). removed punctuation from canonical string. updated tests with new UI strings. --- lighthouse-core/audits/seo/canonical.js | 2 +- lighthouse-core/audits/seo/font-size.js | 4 ++-- lighthouse-core/lib/i18n/en-US.json | 2 +- lighthouse-core/test/audits/seo/canonical-test.js | 5 +++-- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/lighthouse-core/audits/seo/canonical.js b/lighthouse-core/audits/seo/canonical.js index 55063f262356..afd7773452fb 100644 --- a/lighthouse-core/audits/seo/canonical.js +++ b/lighthouse-core/audits/seo/canonical.js @@ -32,7 +32,7 @@ const UIStrings = { 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.', + 'instead of an equivalent page of content', }; const str_ = i18n.createMessageInstanceIdFn(__filename, UIStrings); diff --git a/lighthouse-core/audits/seo/font-size.js b/lighthouse-core/audits/seo/font-size.js index f7529aa37557..3473a502f8a5 100644 --- a/lighthouse-core/audits/seo/font-size.js +++ b/lighthouse-core/audits/seo/font-size.js @@ -294,11 +294,11 @@ class FontSize extends Audit { let explanation; if (!passed) { - const percentageOfFailingText = parseFloat((100 - percentageOfPassingText).toFixed(2)) / 100; + 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).toFixed(2); + const percentageOfVisitedText = (visitedTextLength / totalTextLength); explanation = str_(UIStrings.explanationWithDisclaimer, { decimalProportion: percentageOfFailingText, diff --git a/lighthouse-core/lib/i18n/en-US.json b/lighthouse-core/lib/i18n/en-US.json index 3560d6fe6d02..c8edce1122b2 100644 --- a/lighthouse-core/lib/i18n/en-US.json +++ b/lighthouse-core/lib/i18n/en-US.json @@ -772,7 +772,7 @@ "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.", + "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": { diff --git a/lighthouse-core/test/audits/seo/canonical-test.js b/lighthouse-core/test/audits/seo/canonical-test.js index d584b6317af3..91c4d1550c26 100644 --- a/lighthouse-core/test/audits/seo/canonical-test.js +++ b/lighthouse-core/test/audits/seo/canonical-test.js @@ -120,7 +120,7 @@ describe('SEO: Document has valid canonical link', () => { return CanonicalAudit.audit(artifacts, context).then(auditResult => { assert.equal(auditResult.rawValue, false); expect(auditResult.explanation) - .toBeDisplayString('Points to another hreflang location (https://example.com/)'); + .toBeDisplayString('Points to another `hreflang` location (https://example.com/)'); }); }); @@ -163,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); - expect(auditResult.explanation).toBeDisplayString('Points to a root of the same origin'); + expect(auditResult.explanation).toBeDisplayString('Points to the domain\'s root URL (the ' + + 'homepage), instead of an equivalent page of content'); }); }); From 2d36b31460181ad37cfec0c144257fcd044786f1 Mon Sep 17 00:00:00 2001 From: Shane Exterkamp Date: Tue, 12 Feb 2019 14:26:02 -0800 Subject: [PATCH 27/27] changed displayValue naming --- lighthouse-core/audits/seo/robots-txt.js | 4 ++-- lighthouse-core/lib/i18n/en-US.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lighthouse-core/audits/seo/robots-txt.js b/lighthouse-core/audits/seo/robots-txt.js index 75c20dbda877..36ded8c1eaa4 100644 --- a/lighthouse-core/audits/seo/robots-txt.js +++ b/lighthouse-core/audits/seo/robots-txt.js @@ -42,7 +42,7 @@ const UIStrings = { 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. */ - displayValueHttpError: 'request for robots.txt returned HTTP status: {statusCode, number}', + 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} @@ -210,7 +210,7 @@ class RobotsTxt extends Audit { if (status >= HTTP_SERVER_ERROR_CODE_LOW) { return { rawValue: false, - displayValue: str_(UIStrings.displayValueHttpError, {statusCode: status}), + displayValue: str_(UIStrings.displayValueHttpBadCode, {statusCode: status}), }; } else if (status >= HTTP_CLIENT_ERROR_CODE_LOW || content === '') { return { diff --git a/lighthouse-core/lib/i18n/en-US.json b/lighthouse-core/lib/i18n/en-US.json index c8edce1122b2..f662d39f305e 100644 --- a/lighthouse-core/lib/i18n/en-US.json +++ b/lighthouse-core/lib/i18n/en-US.json @@ -911,7 +911,7 @@ "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 | displayValueHttpError": { + "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." },