Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

i18n: mv locale files #5981

Merged
merged 7 commits into from
Sep 21, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lighthouse-core/audits/bootup-time.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
const Audit = require('./audit');
const NetworkRequest = require('../lib/network-request');
const {taskGroups} = require('../lib/task-groups');
const i18n = require('../lib/i18n');
const i18n = require('../lib/i18n/i18n.js');

const UIStrings = {
/** Title of a diagnostic audit that provides detail on the time spent executing javascript files during the load. This descriptive title is shown to users when the amount is acceptable and no user action is required. */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
const Audit = require('../audit');
const linearInterpolation = require('../../lib/statistics').linearInterpolation;
const Interactive = require('../../gather/computed/metrics/lantern-interactive');
const i18n = require('../../lib/i18n');
const i18n = require('../../lib/i18n/i18n.js');

const str_ = i18n.createMessageInstanceIdFn(__filename, {});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

const NetworkRequest = require('../../lib/network-request');
const ByteEfficiencyAudit = require('./byte-efficiency-audit');
const i18n = require('../../lib/i18n');
const i18n = require('../../lib/i18n/i18n.js');

const UIStrings = {
/** Imperative title of a Lighthouse audit that tells the user to use video formats rather than animated GIFs, which are wasteful. This is displayed in a list of audit titles that Lighthouse generates. */
Expand Down
2 changes: 1 addition & 1 deletion lighthouse-core/audits/byte-efficiency/offscreen-images.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
const ByteEfficiencyAudit = require('./byte-efficiency-audit');
const Sentry = require('../../lib/sentry');
const URL = require('../../lib/url-shim');
const i18n = require('../../lib/i18n');
const i18n = require('../../lib/i18n/i18n.js');

const UIStrings = {
/** Imperative title of a Lighthouse audit that tells the user to defer loading offscreen images. Offscreen images are images located outside of the visible browser viewport. As they are unseen by the user and slow down page load, they should be loaded later, closer to when the user is going to see them. This is displayed in a list of audit titles that Lighthouse generates. */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
'use strict';

const Audit = require('../audit');
const i18n = require('../../lib/i18n');
const i18n = require('../../lib/i18n/i18n.js');
const BaseNode = require('../../lib/dependency-graph/base-node');
const ByteEfficiencyAudit = require('./byte-efficiency-audit');
const UnusedCSS = require('./unused-css-rules');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
'use strict';

const ByteEfficiencyAudit = require('./byte-efficiency-audit');
const i18n = require('../../lib/i18n');
const i18n = require('../../lib/i18n/i18n.js');

const UIStrings = {
/** Title of a diagnostic audit that provides detail on large network resources required during page load. 'Payloads' is roughly equivalent to 'resources'. This descriptive title is shown to users when the amount is acceptable and no user action is required. */
Expand Down
2 changes: 1 addition & 1 deletion lighthouse-core/audits/byte-efficiency/unminified-css.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

const ByteEfficiencyAudit = require('./byte-efficiency-audit');
const UnusedCSSRules = require('./unused-css-rules');
const i18n = require('../../lib/i18n');
const i18n = require('../../lib/i18n/i18n.js');

const UIStrings = {
/** Imperative title of a Lighthouse audit that tells the user to minify (remove whitespace) the page's CSS code. This is displayed in a list of audit titles that Lighthouse generates. */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

const ByteEfficiencyAudit = require('./byte-efficiency-audit');
const esprima = require('esprima');
const i18n = require('../../lib/i18n');
const i18n = require('../../lib/i18n/i18n.js');

const UIStrings = {
/** Imperative title of a Lighthouse audit that tells the user to minify the page’s JS code to reduce file size. This is displayed in a list of audit titles that Lighthouse generates. */
Expand Down
2 changes: 1 addition & 1 deletion lighthouse-core/audits/byte-efficiency/unused-css-rules.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
'use strict';

const ByteEfficiencyAudit = require('./byte-efficiency-audit');
const i18n = require('../../lib/i18n');
const i18n = require('../../lib/i18n/i18n.js');

const UIStrings = {
/** Imperative title of a Lighthouse audit that tells the user to remove content from their CSS that isn’t needed immediately and instead load that content at a later time. This is displayed in a list of audit titles that Lighthouse generates. */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
'use strict';

const ByteEfficiencyAudit = require('./byte-efficiency-audit');
const i18n = require('../../lib/i18n');
const i18n = require('../../lib/i18n/i18n.js');

const UIStrings = {
/** Imperative title of a Lighthouse audit that tells the user to remove JavaScript that is never evaluated during page load. This is displayed in a list of audit titles that Lighthouse generates. */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const Audit = require('../audit');
const NetworkRequest = require('../../lib/network-request');
const URL = require('../../lib/url-shim');
const linearInterpolation = require('../../lib/statistics').linearInterpolation;
const i18n = require('../../lib/i18n');
const i18n = require('../../lib/i18n/i18n.js');

const UIStrings = {
/** Title of a diagnostic audit that provides detail on the cache policy applies to the page's static assets. Cache refers to browser disk cache, which keeps old versions of network resources around for future use. This is displayed in a list of audit titles that Lighthouse generates. */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

const ByteEfficiencyAudit = require('./byte-efficiency-audit');
const URL = require('../../lib/url-shim');
const i18n = require('../../lib/i18n');
const i18n = require('../../lib/i18n/i18n.js');

const UIStrings = {
/** Imperative title of a Lighthouse audit that tells the user to encode images with optimization (better compression). This is displayed in a list of audit titles that Lighthouse generates. */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
const ByteEfficiencyAudit = require('./byte-efficiency-audit');
const Sentry = require('../../lib/sentry');
const URL = require('../../lib/url-shim');
const i18n = require('../../lib/i18n');
const i18n = require('../../lib/i18n/i18n.js');

const UIStrings = {
/** Imperative title of a Lighthouse audit that tells the user to resize images to match the display dimensions. This is displayed in a list of audit titles that Lighthouse generates. */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

const ByteEfficiencyAudit = require('./byte-efficiency-audit');
const URL = require('../../lib/url-shim');
const i18n = require('../../lib/i18n');
const i18n = require('../../lib/i18n/i18n.js');

const UIStrings = {
/** Imperative title of a Lighthouse audit that tells the user to enable text compression (like gzip) in order to enhance the performance of a page. This is displayed in a list of audit titles that Lighthouse generates. */
Expand Down
2 changes: 1 addition & 1 deletion lighthouse-core/audits/byte-efficiency/uses-webp-images.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

const ByteEfficiencyAudit = require('./byte-efficiency-audit');
const URL = require('../../lib/url-shim');
const i18n = require('../../lib/i18n');
const i18n = require('../../lib/i18n/i18n.js');

const UIStrings = {
/** Imperative title of a Lighthouse audit that tells the user to serve images in newer and more efficient image formats in order to enhance the performance of a page. A non-modern image format was designed 20+ years ago. This is displayed in a list of audit titles that Lighthouse generates. */
Expand Down
2 changes: 1 addition & 1 deletion lighthouse-core/audits/critical-request-chains.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
'use strict';

const Audit = require('./audit');
const i18n = require('../lib/i18n');
const i18n = require('../lib/i18n/i18n.js');

const UIStrings = {
/** Imperative title of a Lighthouse audit that tells the user to reduce the depth of critical network requests to enhance initial load of a page. Critical request chains are series of dependent network requests that are important for page rendering. For example, here's a 4-request-deep chain: The biglogo.jpg image is required, but is requested via the styles.css style code, which is requested by the initialize.js javascript, which is requested by the page's HTML. This is displayed in a list of audit titles that Lighthouse generates. */
Expand Down
2 changes: 1 addition & 1 deletion lighthouse-core/audits/dobetterweb/dom-size.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

const Audit = require('../audit');
const Util = require('../../report/html/renderer/util.js');
const i18n = require('../../lib/i18n');
const i18n = require('../../lib/i18n/i18n.js');

const MAX_DOM_NODES = 1500;
const MAX_DOM_TREE_WIDTH = 60;
Expand Down
2 changes: 1 addition & 1 deletion lighthouse-core/audits/font-display.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
const Audit = require('./audit');
const NetworkRequest = require('../lib/network-request');
const allowedFontFaceDisplays = ['block', 'fallback', 'optional', 'swap'];
const i18n = require('../lib/i18n');
const i18n = require('../lib/i18n/i18n.js');

const UIStrings = {
/** Title of a diagnostic audit that provides detail on if all the text on a webpage was visible while the page was loading its webfonts. This descriptive title is shown to users when the amount is acceptable and no user action is required. */
Expand Down
2 changes: 1 addition & 1 deletion lighthouse-core/audits/mainthread-work-breakdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

const Audit = require('./audit');
const {taskGroups} = require('../lib/task-groups');
const i18n = require('../lib/i18n');
const i18n = require('../lib/i18n/i18n.js');

const UIStrings = {
/** Title of a diagnostic audit that provides detail on the main thread work the browser did to load the page. This descriptive title is shown to users when the amount is acceptable and no user action is required. */
Expand Down
2 changes: 1 addition & 1 deletion lighthouse-core/audits/metrics/estimated-input-latency.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
'use strict';

const Audit = require('../audit');
const i18n = require('../../lib/i18n');
const i18n = require('../../lib/i18n/i18n.js');

const UIStrings = {
/** The name of the metric that marks the estimated time between the page receiving input (a user clicking, tapping, or typing) and the page responding. Shown to users as the label for the numeric metric value. Ideally fits within a ~40 character limit. */
Expand Down
2 changes: 1 addition & 1 deletion lighthouse-core/audits/metrics/first-contentful-paint.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
'use strict';

const Audit = require('../audit');
const i18n = require('../../lib/i18n');
const i18n = require('../../lib/i18n/i18n.js');

const UIStrings = {
/** The name of the metric that marks the time at which the first text or image is painted by the browser. Shown to users as the label for the numeric metric value. Ideally fits within a ~40 character limit. */
Expand Down
2 changes: 1 addition & 1 deletion lighthouse-core/audits/metrics/first-cpu-idle.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
'use strict';

const Audit = require('../audit');
const i18n = require('../../lib/i18n');
const i18n = require('../../lib/i18n/i18n.js');

const UIStrings = {
/** The name of the metric that marks when the page has displayed content and the CPU is not busy executing the page's scripts. Shown to users as the label for the numeric metric value. Ideally fits within a ~40 character limit. */
Expand Down
2 changes: 1 addition & 1 deletion lighthouse-core/audits/metrics/first-meaningful-paint.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
'use strict';

const Audit = require('../audit');
const i18n = require('../../lib/i18n');
const i18n = require('../../lib/i18n/i18n.js');

const UIStrings = {
/** The name of the metric that marks the time at which a majority of the content has been painted by the browser. Shown to users as the label for the numeric metric value. Ideally fits within a ~40 character limit. */
Expand Down
2 changes: 1 addition & 1 deletion lighthouse-core/audits/metrics/interactive.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
'use strict';

const Audit = require('../audit');
const i18n = require('../../lib/i18n');
const i18n = require('../../lib/i18n/i18n.js');

const UIStrings = {
/** The name of the metric that marks the time at which the page is fully loaded and is able to quickly respond to user input (clicks, taps, and keypresses feel responsive). Shown to users as the label for the numeric metric value. Ideally fits within a ~40 character limit. */
Expand Down
2 changes: 1 addition & 1 deletion lighthouse-core/audits/metrics/speed-index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
'use strict';

const Audit = require('../audit');
const i18n = require('../../lib/i18n');
const i18n = require('../../lib/i18n/i18n.js');

const UIStrings = {
/** The name of the metric that summarizes how quickly the page looked visually complete. The name of this metric is largely abstract and can be loosely translated. Shown to users as the label for the numeric metric value. Ideally fits within a ~40 character limit. */
Expand Down
2 changes: 1 addition & 1 deletion lighthouse-core/audits/redirects.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

const Audit = require('./audit');
const UnusedBytes = require('./byte-efficiency/byte-efficiency-audit');
const i18n = require('../lib/i18n');
const i18n = require('../lib/i18n/i18n.js');

const UIStrings = {
/** 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. */
Expand Down
2 changes: 1 addition & 1 deletion lighthouse-core/audits/time-to-first-byte.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
'use strict';

const Audit = require('./audit');
const i18n = require('../lib/i18n');
const i18n = require('../lib/i18n/i18n.js');

const UIStrings = {
/** Title of a diagnostic audit that provides detail on how long it took from starting a request to when the server started responding. This descriptive title is shown to users when the amount is acceptable and no user action is required. */
Expand Down
2 changes: 1 addition & 1 deletion lighthouse-core/audits/user-timings.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
'use strict';

const Audit = require('./audit');
const i18n = require('../lib/i18n');
const i18n = require('../lib/i18n/i18n.js');

const UIStrings = {
/** Descriptive title of a diagnostic audit that provides details on any timestamps generated by the page. User Timing refers to the 'User Timing API', which enables a website to record specific times as 'marks', or spans of time as 'measures'. */
Expand Down
2 changes: 1 addition & 1 deletion lighthouse-core/audits/uses-rel-preconnect.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

const Audit = require('./audit');
const UnusedBytes = require('./byte-efficiency/byte-efficiency-audit');
const i18n = require('../lib/i18n');
const i18n = require('../lib/i18n/i18n.js');

// Preconnect establishes a "clean" socket. Chrome's socket manager will keep an unused socket
// around for 10s. Meaning, the time delta between processing preconnect a request should be <10s,
Expand Down
2 changes: 1 addition & 1 deletion lighthouse-core/audits/uses-rel-preload.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const URL = require('../lib/url-shim');
const Audit = require('./audit');
const UnusedBytes = require('./byte-efficiency/byte-efficiency-audit');
const CriticalRequestChains = require('../gather/computed/critical-request-chains');
const i18n = require('../lib/i18n');
const i18n = require('../lib/i18n/i18n.js');

const UIStrings = {
/** Imperative title of a Lighthouse audit that tells the user to use <link rel=preload> to initiate important network requests earlier during page load. This is displayed in a list of audit titles that Lighthouse generates. */
Expand Down
2 changes: 1 addition & 1 deletion lighthouse-core/config/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const defaultConfigPath = './default-config.js';
const defaultConfig = require('./default-config.js');
const fullConfig = require('./full-config.js');
const constants = require('./constants.js');
const i18n = require('./../lib/i18n.js');
const i18n = require('./../lib/i18n/i18n.js');

const isDeepEqual = require('lodash.isequal');
const log = require('lighthouse-logger');
Expand Down
2 changes: 1 addition & 1 deletion lighthouse-core/config/default-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
/* eslint-disable max-len */

const constants = require('./constants');
const i18n = require('../lib/i18n');
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. */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -383,43 +383,43 @@
"message": "Performance",
"description": "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."
},
"lighthouse-core/lib/i18n.js | columnCacheTTL": {
"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"
},
"lighthouse-core/lib/i18n.js | columnSize": {
"lighthouse-core/lib/i18n/i18n.js | columnSize": {
"message": "Size (KB)",
"description": "Label for the size column in data tables, entries will be the size of a web resource in kilobytes"
},
"lighthouse-core/lib/i18n.js | columnTimeSpent": {
"lighthouse-core/lib/i18n/i18n.js | columnTimeSpent": {
"message": "Time Spent",
"description": "Label for the time spent column in data tables, entries will be the number of milliseconds spent during a particular activity"
},
"lighthouse-core/lib/i18n.js | columnURL": {
"lighthouse-core/lib/i18n/i18n.js | columnURL": {
"message": "URL",
"description": "Label for the URL column in data tables, entries will be the URL of a web resource"
},
"lighthouse-core/lib/i18n.js | columnWastedBytes": {
"lighthouse-core/lib/i18n/i18n.js | columnWastedBytes": {
"message": "Potential Savings (KB)",
"description": "Label for the wasted bytes column in data tables, entries will be the number of kilobytes the user could reduce their page by if they implemented the suggestions"
},
"lighthouse-core/lib/i18n.js | columnWastedMs": {
"lighthouse-core/lib/i18n/i18n.js | columnWastedMs": {
"message": "Potential Savings (ms)",
"description": "Label for the wasted bytes column in data tables, entries will be the number of milliseconds the user could reduce page load by if they implemented the suggestions"
},
"lighthouse-core/lib/i18n.js | displayValueByteSavings": {
"lighthouse-core/lib/i18n/i18n.js | displayValueByteSavings": {
"message": "Potential savings of {wastedBytes, number, bytes} KB",
"description": "Label shown per-audit to show how many bytes smaller the page could be if the user implemented the suggestions. The `{wastedBytes}` placeholder will be replaced with the number of bytes, shown in kilobytes (e.g. 148 KB)"
},
"lighthouse-core/lib/i18n.js | displayValueMsSavings": {
"lighthouse-core/lib/i18n/i18n.js | displayValueMsSavings": {
"message": "Potential savings of {wastedMs, number, milliseconds} ms",
"description": "Label shown per-audit to show how many milliseconds faster the page load could be if the user implemented the suggestions. The `{wastedMs}` placeholder will be replaced with the time duration, shown in milliseconds (e.g. 140 ms)"
},
"lighthouse-core/lib/i18n.js | ms": {
"lighthouse-core/lib/i18n/i18n.js | ms": {
"message": "{timeInMs, number, milliseconds} ms",
"description": "Used to show the duration in milliseconds that something lasted. The `{timeInMs}` placeholder will be replaced with the time duration, shown in milliseconds (e.g. 63 ms)"
},
"lighthouse-core/lib/i18n.js | seconds": {
"lighthouse-core/lib/i18n/i18n.js | seconds": {
"message": "{timeInMs, number, seconds} s",
"description": "Used to show the duration in seconds that something lasted. The {timeInMs} placeholder will be replaced with the time duration, shown in seconds (e.g. 5.2 s)"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ const log = require('lighthouse-logger');
const MessageFormat = require('intl-messageformat').default;
const MessageParser = require('intl-messageformat-parser');
const lookupClosestLocale = require('lookup-closest-locale');
const LOCALES = require('./locales');
const LOCALES = require('./locales.js');

const LH_ROOT = path.join(__dirname, '../../');
const LH_ROOT = path.join(__dirname, '../../../');
const MESSAGE_INSTANCE_ID_REGEX = /(.* \| .*) # (\d+)$/;
// Above regex is very slow against large strings. Use QUICK_REGEX as a much quicker discriminator.
const MESSAGE_INSTANCE_ID_QUICK_REGEX = / # \d+$/;
Expand Down
Loading