lighthouse 12.8.0 → 12.8.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (57) hide show
  1. package/cli/test/smokehouse/config/exclusions.js +2 -0
  2. package/core/audits/network-requests.js +12 -0
  3. package/core/lib/legacy-javascript/legacy-javascript.js +11 -4
  4. package/dist/report/flow.js +8 -8
  5. package/package.json +4 -4
  6. package/shared/localization/locales/ar-XB.json +43 -10
  7. package/shared/localization/locales/ar.json +43 -10
  8. package/shared/localization/locales/bg.json +42 -9
  9. package/shared/localization/locales/ca.json +43 -10
  10. package/shared/localization/locales/cs.json +44 -11
  11. package/shared/localization/locales/da.json +47 -14
  12. package/shared/localization/locales/de.json +43 -10
  13. package/shared/localization/locales/el.json +40 -7
  14. package/shared/localization/locales/en-GB.json +40 -7
  15. package/shared/localization/locales/en-XA.json +43 -10
  16. package/shared/localization/locales/es-419.json +42 -9
  17. package/shared/localization/locales/es.json +40 -7
  18. package/shared/localization/locales/fi.json +43 -10
  19. package/shared/localization/locales/fil.json +43 -10
  20. package/shared/localization/locales/fr.json +39 -6
  21. package/shared/localization/locales/he.json +41 -8
  22. package/shared/localization/locales/hi.json +43 -10
  23. package/shared/localization/locales/hr.json +41 -8
  24. package/shared/localization/locales/hu.json +41 -8
  25. package/shared/localization/locales/id.json +45 -12
  26. package/shared/localization/locales/it.json +40 -7
  27. package/shared/localization/locales/ja.json +41 -8
  28. package/shared/localization/locales/ko.json +42 -9
  29. package/shared/localization/locales/lt.json +42 -9
  30. package/shared/localization/locales/lv.json +43 -10
  31. package/shared/localization/locales/nl.json +41 -8
  32. package/shared/localization/locales/no.json +42 -9
  33. package/shared/localization/locales/pl.json +42 -9
  34. package/shared/localization/locales/pt-PT.json +43 -10
  35. package/shared/localization/locales/pt.json +43 -10
  36. package/shared/localization/locales/ro.json +43 -10
  37. package/shared/localization/locales/ru.json +42 -9
  38. package/shared/localization/locales/sk.json +42 -9
  39. package/shared/localization/locales/sl.json +42 -9
  40. package/shared/localization/locales/sr-Latn.json +43 -10
  41. package/shared/localization/locales/sr.json +43 -10
  42. package/shared/localization/locales/sv.json +42 -9
  43. package/shared/localization/locales/ta.json +43 -10
  44. package/shared/localization/locales/te.json +44 -11
  45. package/shared/localization/locales/th.json +41 -8
  46. package/shared/localization/locales/tr.json +46 -13
  47. package/shared/localization/locales/uk.json +43 -10
  48. package/shared/localization/locales/vi.json +41 -8
  49. package/shared/localization/locales/zh-HK.json +44 -11
  50. package/shared/localization/locales/zh-TW.json +45 -12
  51. package/shared/localization/locales/zh.json +39 -6
  52. package/shared/localization/locales.d.ts +0 -2
  53. package/shared/localization/locales.js +139 -130
  54. package/shared/tsconfig.json +0 -2
  55. package/third-party/chromium-synchronization/inspector-issueAdded-types-test.js +1 -0
  56. package/tsconfig-base.json +1 -1
  57. package/tsconfig.json +0 -1
@@ -660,7 +660,7 @@
660
660
  "message": "使用影片格式的動畫內容"
661
661
  },
662
662
  "core/audits/byte-efficiency/legacy-javascript.js | description": {
663
- "message": "Polyfills and transforms enable legacy browsers to use new JavaScript features. However, many aren't necessary for modern browsers. Consider modifying your JavaScript build process to not transpile [Baseline](https://web.dev/baseline) features, unless you know you must support legacy browsers. [Learn why most sites can deploy ES6+ code without transpiling](https://philipwalton.com/articles/the-state-of-es5-on-the-web/)"
663
+ "message": "Polyfill 和轉換作業可讓舊版瀏覽器使用新版 JavaScript 的功能,但對新式瀏覽器來說,很多都是不需要的功能。除非你認為必須支援舊版瀏覽器,否則建議修改 JavaScript 建構程序,不要轉譯[基準](https://web.dev/baseline)功能。[瞭解為何大多數網站不需要轉譯,就能部署 ES6+ 程式碼](https://philipwalton.com/articles/the-state-of-es5-on-the-web/)"
664
664
  },
665
665
  "core/audits/byte-efficiency/legacy-javascript.js | detectedCoreJs2Warning": {
666
666
  "message": "系統偵測到網頁採用 core-js 第 2 版。第 3 版大幅提升效能,請務必升級。"
@@ -1188,7 +1188,7 @@
1188
1188
  "message": "使用者可能會遇到的最長「首次輸入延遲時間」就是耗時最久的工作持續時間。[進一步瞭解「可能的最長首次輸入延遲時間」指標](https://developer.chrome.com/docs/lighthouse/performance/lighthouse-max-potential-fid/)。"
1189
1189
  },
1190
1190
  "core/audits/metrics/speed-index.js | description": {
1191
- "message": "速度指數會顯示網頁可見內容的填入速度。[進一步瞭解「速度指數」指標](https://developer.chrome.com/docs/lighthouse/performance/speed-index/)。"
1191
+ "message": "速度指數會顯示網頁可見內容的填入速度。[進一步瞭解「Speed Index」指標](https://developer.chrome.com/docs/lighthouse/performance/speed-index/)。"
1192
1192
  },
1193
1193
  "core/audits/metrics/total-blocking-time.js | description": {
1194
1194
  "message": "當工作長度超過 50 毫秒時,從 FCP 到互動準備時間的時間範圍總計 (以毫秒為單位)。[進一步瞭解「總封鎖時間」指標](https://developer.chrome.com/docs/lighthouse/performance/lighthouse-total-blocking-time/)。"
@@ -1440,7 +1440,7 @@
1440
1440
  "message": "初始伺服器回應時間很短"
1441
1441
  },
1442
1442
  "core/audits/third-party-cookies.js | description": {
1443
- "message": " Chrome 中瀏覽網頁時,將可選擇不用第三方 Cookie。[進一步瞭解第三方 Cookie](https://developers.google.com/privacy-sandbox/cookies)。"
1443
+ "message": "第三方 Cookie 可能會在某些情況下遭到封鎖。[進一步瞭解如何因應第三方 Cookie 限制](https://privacysandbox.google.com/cookies/prepare/overview)。"
1444
1444
  },
1445
1445
  "core/audits/third-party-cookies.js | displayValue": {
1446
1446
  "message": "{itemCount,plural, =1{找到 1 個 Cookie}other{找到 # 個 Cookie}}"
@@ -1493,6 +1493,18 @@
1493
1493
  "core/audits/third-party-summary.js | title": {
1494
1494
  "message": "盡量減少第三方程式碼的使用量"
1495
1495
  },
1496
+ "core/audits/trusted-types-xss.js | columnSeverity": {
1497
+ "message": "嚴重程度"
1498
+ },
1499
+ "core/audits/trusted-types-xss.js | description": {
1500
+ "message": "`Content-Security-Policy` (CSP) 標頭中的 `require-trusted-types-for` 指令會指示使用者代理程式控管傳遞至 DOM XSS sink 函式的資料。[進一步瞭解如何使用 Trusted Types 減輕 DOM 型 XSS 攻擊的影響](https://developer.chrome.com/docs/lighthouse/best-practices/trusted-types-xss)。"
1501
+ },
1502
+ "core/audits/trusted-types-xss.js | noTrustedTypesToMitigateXss": {
1503
+ "message": "找不到含有 Trusted Types 指令的 `Content-Security-Policy` 標頭"
1504
+ },
1505
+ "core/audits/trusted-types-xss.js | title": {
1506
+ "message": "使用 Trusted Types 減輕 DOM 型 XSS 攻擊的影響"
1507
+ },
1496
1508
  "core/audits/unsized-images.js | description": {
1497
1509
  "message": "請明確設定圖片元素的寬度和高度,以減少版面配置轉移並改善 CLS。[瞭解如何設定圖片尺寸](https://web.dev/articles/optimize-cls#images_without_dimensions)"
1498
1510
  },
@@ -1676,11 +1688,17 @@
1676
1688
  "core/config/default-config.js | firstPaintImprovementsGroupTitle": {
1677
1689
  "message": "改進首次繪製程序"
1678
1690
  },
1691
+ "core/config/default-config.js | insightsGroupDescription": {
1692
+ "message": "你也可以前往 Chrome 開發人員工具的「效能」面板查看這些深入分析結果。只要[記錄追蹤記錄](https://developer.chrome.com/docs/devtools/performance/reference),即可查看更詳細的資訊。"
1693
+ },
1694
+ "core/config/default-config.js | insightsGroupTitle": {
1695
+ "message": "深入分析"
1696
+ },
1679
1697
  "core/config/default-config.js | metricGroupTitle": {
1680
1698
  "message": "指標"
1681
1699
  },
1682
1700
  "core/config/default-config.js | overallImprovementsGroupDescription": {
1683
- "message": "改進整體載入體驗,採用回應式頁面設計,儘快為使用者提供服務。重點指標:可互動時間、速度指數"
1701
+ "message": "改進整體載入體驗,採用回應式頁面設計,儘快為使用者提供服務。重點指標:可互動時間、Speed Index"
1684
1702
  },
1685
1703
  "core/config/default-config.js | overallImprovementsGroupTitle": {
1686
1704
  "message": "整體改進"
@@ -1857,22 +1875,22 @@
1857
1875
  "message": "網址"
1858
1876
  },
1859
1877
  "core/lib/i18n/i18n.js | columnWastedBytes": {
1860
- "message": "可節省的數據用量"
1878
+ "message": "預估可節省的 KiB"
1861
1879
  },
1862
1880
  "core/lib/i18n/i18n.js | columnWastedMs": {
1863
- "message": "可節省的時間"
1881
+ "message": "預估可節省的毫秒數"
1864
1882
  },
1865
1883
  "core/lib/i18n/i18n.js | cumulativeLayoutShiftMetric": {
1866
1884
  "message": "Cumulative Layout Shift"
1867
1885
  },
1868
1886
  "core/lib/i18n/i18n.js | displayValueByteSavings": {
1869
- "message": "可減少 {wastedBytes, number, bytes} KiB"
1887
+ "message": "預估可省下 {wastedBytes, number, bytes} KiB"
1870
1888
  },
1871
1889
  "core/lib/i18n/i18n.js | displayValueElementsFound": {
1872
1890
  "message": "{nodeCount,plural, =1{找到 1 個元素}other{找到 # 個元素}}"
1873
1891
  },
1874
1892
  "core/lib/i18n/i18n.js | displayValueMsSavings": {
1875
- "message": "可減少 {wastedMs, number, milliseconds} 毫秒"
1893
+ "message": "預估可省下 {wastedMs, number, milliseconds} 毫秒"
1876
1894
  },
1877
1895
  "core/lib/i18n/i18n.js | documentResourceType": {
1878
1896
  "message": "文件"
@@ -2070,7 +2088,7 @@
2070
2088
  "message": "取得 Lighthouse 效能分數。"
2071
2089
  },
2072
2090
  "flow-report/src/i18n/ui-strings.js | helpUseCaseNavigation2": {
2073
- "message": "評估載入網頁的效能指標,例如最大內容繪製和速度指數。"
2091
+ "message": "評估載入網頁的效能指標,例如最大內容繪製和 Speed Index。"
2074
2092
  },
2075
2093
  "flow-report/src/i18n/ui-strings.js | helpUseCaseNavigation3": {
2076
2094
  "message": "評估漸進式網頁應用程式功能。"
@@ -3575,9 +3593,15 @@
3575
3593
  "report/renderer/report-utils.js | footerIssue": {
3576
3594
  "message": "回報問題"
3577
3595
  },
3596
+ "report/renderer/report-utils.js | goBackToAudits": {
3597
+ "message": "返回稽核"
3598
+ },
3578
3599
  "report/renderer/report-utils.js | hide": {
3579
3600
  "message": "隱藏"
3580
3601
  },
3602
+ "report/renderer/report-utils.js | insightsNotice": {
3603
+ "message": "深入分析功能將於今年內取代效能審查。如要瞭解詳情並提供意見,請按[這裡](https://github.com/GoogleChrome/lighthouse/discussions/16462)。"
3604
+ },
3581
3605
  "report/renderer/report-utils.js | labDataTitle": {
3582
3606
  "message": "研究資料"
3583
3607
  },
@@ -3677,6 +3701,9 @@
3677
3701
  "report/renderer/report-utils.js | toplevelWarningsMessage": {
3678
3702
  "message": "有問題導致 Lighthouse 無法順利執行這項作業:"
3679
3703
  },
3704
+ "report/renderer/report-utils.js | tryInsights": {
3705
+ "message": "善用深入分析資料"
3706
+ },
3680
3707
  "report/renderer/report-utils.js | unattributable": {
3681
3708
  "message": "無法歸因"
3682
3709
  },
@@ -3707,16 +3734,22 @@
3707
3734
  "treemap/app/src/util.js | duplicateModulesLabel": {
3708
3735
  "message": "重複模組"
3709
3736
  },
3737
+ "treemap/app/src/util.js | duplicatedBytesLabel": {
3738
+ "message": "重複的位元組數"
3739
+ },
3710
3740
  "treemap/app/src/util.js | resourceBytesLabel": {
3711
- "message": "資源位元組"
3741
+ "message": "資源位元組數"
3712
3742
  },
3713
3743
  "treemap/app/src/util.js | tableColumnName": {
3714
3744
  "message": "名稱"
3715
3745
  },
3716
3746
  "treemap/app/src/util.js | toggleTableButtonLabel": {
3717
- "message": "顯示/隱藏表格"
3747
+ "message": "顯示或隱藏表格"
3748
+ },
3749
+ "treemap/app/src/util.js | transferBytesLabel": {
3750
+ "message": "傳輸位元組數"
3718
3751
  },
3719
3752
  "treemap/app/src/util.js | unusedBytesLabel": {
3720
- "message": "未使用的位元組"
3753
+ "message": "未使用的位元組數"
3721
3754
  }
3722
3755
  }
@@ -1440,7 +1440,7 @@
1440
1440
  "message": "初始服务器响应用时较短"
1441
1441
  },
1442
1442
  "core/audits/third-party-cookies.js | description": {
1443
- "message": "Chrome 将推出新的用户体验,使用户可以选择不使用第三方 Cookie 来浏览网页。[详细了解第三方 Cookie](https://developers.google.com/privacy-sandbox/cookies)。"
1443
+ "message": "在某些情况下,第三方 Cookie 可能会被屏蔽。[详细了解如何为第三方 Cookie 限制做好准备](https://privacysandbox.google.com/cookies/prepare/overview)。"
1444
1444
  },
1445
1445
  "core/audits/third-party-cookies.js | displayValue": {
1446
1446
  "message": "{itemCount,plural, =1{找到 1 个 Cookie}other{找到 # 个 Cookie}}"
@@ -1493,6 +1493,18 @@
1493
1493
  "core/audits/third-party-summary.js | title": {
1494
1494
  "message": "尽量减少第三方使用"
1495
1495
  },
1496
+ "core/audits/trusted-types-xss.js | columnSeverity": {
1497
+ "message": "严重程度"
1498
+ },
1499
+ "core/audits/trusted-types-xss.js | description": {
1500
+ "message": "`Content-Security-Policy` (CSP) 标头中的 `require-trusted-types-for` 指令会指示用户代理控制传递给 DOM XSS 接收器函数的数据。[详细了解如何使用 Trusted Types 缓解基于 DOM 的 XSS 攻击](https://developer.chrome.com/docs/lighthouse/best-practices/trusted-types-xss)。"
1501
+ },
1502
+ "core/audits/trusted-types-xss.js | noTrustedTypesToMitigateXss": {
1503
+ "message": "未找到包含 Trusted Types 指令的 `Content-Security-Policy` 标头"
1504
+ },
1505
+ "core/audits/trusted-types-xss.js | title": {
1506
+ "message": "使用 Trusted Types 缓解基于 DOM 的 XSS 攻击"
1507
+ },
1496
1508
  "core/audits/unsized-images.js | description": {
1497
1509
  "message": "请为图片元素设置明确的宽度值和高度值,以减少布局偏移并改善 CLS。[了解如何设置图片尺寸](https://web.dev/articles/optimize-cls#images_without_dimensions)"
1498
1510
  },
@@ -1676,11 +1688,17 @@
1676
1688
  "core/config/default-config.js | firstPaintImprovementsGroupTitle": {
1677
1689
  "message": "改进首次绘制"
1678
1690
  },
1691
+ "core/config/default-config.js | insightsGroupDescription": {
1692
+ "message": "您还可在 Chrome 开发者工具的“性能”面板中查看这些数据分析。只要[记录跟踪信息](https://developer.chrome.com/docs/devtools/performance/reference),即可查看更详细的信息。"
1693
+ },
1694
+ "core/config/default-config.js | insightsGroupTitle": {
1695
+ "message": "数据分析"
1696
+ },
1679
1697
  "core/config/default-config.js | metricGroupTitle": {
1680
1698
  "message": "指标"
1681
1699
  },
1682
1700
  "core/config/default-config.js | overallImprovementsGroupDescription": {
1683
- "message": "改善整体的加载体验,使该网页响应迅速且可尽快投入使用。关键指标:可交互前的耗时、速度指数"
1701
+ "message": "改善整体的加载体验,使该网页响应迅速且可尽快投入使用。关键指标:可交互前的耗时、Speed Index"
1684
1702
  },
1685
1703
  "core/config/default-config.js | overallImprovementsGroupTitle": {
1686
1704
  "message": "整体改进"
@@ -1857,22 +1875,22 @@
1857
1875
  "message": "网址"
1858
1876
  },
1859
1877
  "core/lib/i18n/i18n.js | columnWastedBytes": {
1860
- "message": "可能达到的节省程度"
1878
+ "message": "预计节省的字节数"
1861
1879
  },
1862
1880
  "core/lib/i18n/i18n.js | columnWastedMs": {
1863
- "message": "可能达到的节省程度"
1881
+ "message": "预计缩短的毫秒数"
1864
1882
  },
1865
1883
  "core/lib/i18n/i18n.js | cumulativeLayoutShiftMetric": {
1866
1884
  "message": "Cumulative Layout Shift"
1867
1885
  },
1868
1886
  "core/lib/i18n/i18n.js | displayValueByteSavings": {
1869
- "message": "有望节省 {wastedBytes, number, bytes} KiB"
1887
+ "message": "预计节省 {wastedBytes, number, bytes} KiB"
1870
1888
  },
1871
1889
  "core/lib/i18n/i18n.js | displayValueElementsFound": {
1872
1890
  "message": "{nodeCount,plural, =1{发现了 1 个元素}other{发现了 # 个元素}}"
1873
1891
  },
1874
1892
  "core/lib/i18n/i18n.js | displayValueMsSavings": {
1875
- "message": "有望节省 {wastedMs, number, milliseconds} 毫秒"
1893
+ "message": "预计缩短 {wastedMs, number, milliseconds} 毫秒"
1876
1894
  },
1877
1895
  "core/lib/i18n/i18n.js | documentResourceType": {
1878
1896
  "message": "文档"
@@ -3575,9 +3593,15 @@
3575
3593
  "report/renderer/report-utils.js | footerIssue": {
3576
3594
  "message": "提交问题"
3577
3595
  },
3596
+ "report/renderer/report-utils.js | goBackToAudits": {
3597
+ "message": "返回审核部分"
3598
+ },
3578
3599
  "report/renderer/report-utils.js | hide": {
3579
3600
  "message": "隐藏"
3580
3601
  },
3602
+ "report/renderer/report-utils.js | insightsNotice": {
3603
+ "message": "今年晚些时候,数据分析将取代效果审核。[点击此处了解详情并提供反馈](https://github.com/GoogleChrome/lighthouse/discussions/16462)。"
3604
+ },
3581
3605
  "report/renderer/report-utils.js | labDataTitle": {
3582
3606
  "message": "实验室数据"
3583
3607
  },
@@ -3677,6 +3701,9 @@
3677
3701
  "report/renderer/report-utils.js | toplevelWarningsMessage": {
3678
3702
  "message": "此次 Lighthouse 运行并不顺利,原因如下:"
3679
3703
  },
3704
+ "report/renderer/report-utils.js | tryInsights": {
3705
+ "message": "试用数据分析功能"
3706
+ },
3680
3707
  "report/renderer/report-utils.js | unattributable": {
3681
3708
  "message": "无法归因"
3682
3709
  },
@@ -3707,6 +3734,9 @@
3707
3734
  "treemap/app/src/util.js | duplicateModulesLabel": {
3708
3735
  "message": "重复的模块"
3709
3736
  },
3737
+ "treemap/app/src/util.js | duplicatedBytesLabel": {
3738
+ "message": "重复的字节数"
3739
+ },
3710
3740
  "treemap/app/src/util.js | resourceBytesLabel": {
3711
3741
  "message": "资源字节数"
3712
3742
  },
@@ -3716,6 +3746,9 @@
3716
3746
  "treemap/app/src/util.js | toggleTableButtonLabel": {
3717
3747
  "message": "显示/隐藏表格"
3718
3748
  },
3749
+ "treemap/app/src/util.js | transferBytesLabel": {
3750
+ "message": "传输字节数"
3751
+ },
3719
3752
  "treemap/app/src/util.js | unusedBytesLabel": {
3720
3753
  "message": "未使用的字节数"
3721
3754
  }
@@ -2,8 +2,6 @@ export type Locale = import("../../types/lhr/settings").Locale;
2
2
  export type LhlMessages = Record<string, {
3
3
  message: string;
4
4
  }>;
5
- /** @typedef {import('../../types/lhr/settings').Locale} Locale */
6
- /** @typedef {Record<string, {message: string}>} LhlMessages */
7
5
  /** @type {Record<Locale, LhlMessages>} */
8
6
  export const locales: Record<Locale, LhlMessages>;
9
7
  //# sourceMappingURL=locales.d.ts.map
@@ -21,149 +21,158 @@
21
21
 
22
22
  // TODO(paulirish): Centralize locale inheritance (combining this & i18n.lookupLocale()), adopt cldr parentLocale rules.
23
23
 
24
- import ar from './locales/ar.json' with { type: 'json' };
25
- import arXB from './locales/ar-XB.json' with { type: 'json' };
26
- import bg from './locales/bg.json' with { type: 'json' };
27
- import ca from './locales/ca.json' with { type: 'json'};
28
- import cs from './locales/cs.json' with { type: 'json'};
29
- import da from './locales/da.json' with { type: 'json'};
30
- import de from './locales/de.json' with { type: 'json'};
31
- import el from './locales/el.json' with { type: 'json'};
32
- import enGB from './locales/en-GB.json' with { type: 'json'};
33
- import enUS from './locales/en-US.json' with { type: 'json'};
34
- import enXA from './locales/en-XA.json' with { type: 'json'};
35
- import enXL from './locales/en-XL.json' with { type: 'json'};
36
- import es from './locales/es.json' with { type: 'json'};
37
- import es419 from './locales/es-419.json' with { type: 'json'};
38
- import fi from './locales/fi.json' with { type: 'json'};
39
- import fil from './locales/fil.json' with { type: 'json'};
40
- import fr from './locales/fr.json' with { type: 'json'};
41
- import he from './locales/he.json' with { type: 'json'};
42
- import hi from './locales/hi.json' with { type: 'json'};
43
- import hr from './locales/hr.json' with { type: 'json'};
44
- import hu from './locales/hu.json' with { type: 'json'};
45
- import id from './locales/id.json' with { type: 'json'};
46
- import it from './locales/it.json' with { type: 'json'};
47
- import ja from './locales/ja.json' with { type: 'json'};
48
- import ko from './locales/ko.json' with { type: 'json'};
49
- import lt from './locales/lt.json' with { type: 'json'};
50
- import lv from './locales/lv.json' with { type: 'json'};
51
- import nl from './locales/nl.json' with { type: 'json'};
52
- import no from './locales/no.json' with { type: 'json'};
53
- import pl from './locales/pl.json' with { type: 'json'};
54
- import pt from './locales/pt.json' with { type: 'json'};
55
- import ptPT from './locales/pt-PT.json' with { type: 'json'};
56
- import ro from './locales/ro.json' with { type: 'json'};
57
- import ru from './locales/ru.json' with { type: 'json'};
58
- import sk from './locales/sk.json' with { type: 'json'};
59
- import sl from './locales/sl.json' with { type: 'json'};
60
- import sr from './locales/sr.json' with { type: 'json'};
61
- import srLatn from './locales/sr-Latn.json' with { type: 'json'};
62
- import sv from './locales/sv.json' with { type: 'json'};
63
- import ta from './locales/ta.json' with { type: 'json'};
64
- import te from './locales/te.json' with { type: 'json'};
65
- import th from './locales/th.json' with { type: 'json'};
66
- import tr from './locales/tr.json' with { type: 'json'};
67
- import uk from './locales/uk.json' with { type: 'json'};
68
- import vi from './locales/vi.json' with { type: 'json'};
69
- import zh from './locales/zh.json' with { type: 'json'};
70
- import zhHK from './locales/zh-HK.json' with { type: 'json'};
71
- import zhTW from './locales/zh-TW.json' with { type: 'json'};
24
+ import fs from 'fs';
25
+
26
+ import {getModuleDirectory} from '../esm-utils.js';
72
27
 
73
28
  /** @typedef {import('../../types/lhr/settings').Locale} Locale */
74
29
  /** @typedef {Record<string, {message: string}>} LhlMessages */
75
30
 
31
+ const moduleDir = getModuleDirectory(import.meta);
32
+
33
+ /** @type {Record<string, LhlMessages>} */
34
+ const files = {
35
+ 'ar': JSON.parse(fs.readFileSync(`${moduleDir}/locales/ar.json`, 'utf8')),
36
+ 'ar-XB': JSON.parse(fs.readFileSync(`${moduleDir}/locales/ar-XB.json`, 'utf8')),
37
+ 'bg': JSON.parse(fs.readFileSync(`${moduleDir}/locales/bg.json`, 'utf8')),
38
+ 'ca': JSON.parse(fs.readFileSync(`${moduleDir}/locales/ca.json`, 'utf8')),
39
+ 'cs': JSON.parse(fs.readFileSync(`${moduleDir}/locales/cs.json`, 'utf8')),
40
+ 'da': JSON.parse(fs.readFileSync(`${moduleDir}/locales/da.json`, 'utf8')),
41
+ 'de': JSON.parse(fs.readFileSync(`${moduleDir}/locales/de.json`, 'utf8')),
42
+ 'el': JSON.parse(fs.readFileSync(`${moduleDir}/locales/el.json`, 'utf8')),
43
+ 'en-GB': JSON.parse(fs.readFileSync(`${moduleDir}/locales/en-GB.json`, 'utf8')),
44
+ 'en-US': JSON.parse(fs.readFileSync(`${moduleDir}/locales/en-US.json`, 'utf8')),
45
+ 'en-XA': JSON.parse(fs.readFileSync(`${moduleDir}/locales/en-XA.json`, 'utf8')),
46
+ 'en-XL': JSON.parse(fs.readFileSync(`${moduleDir}/locales/en-XL.json`, 'utf8')),
47
+ 'es': JSON.parse(fs.readFileSync(`${moduleDir}/locales/es.json`, 'utf8')),
48
+ 'es-419': JSON.parse(fs.readFileSync(`${moduleDir}/locales/es-419.json`, 'utf8')),
49
+ 'fi': JSON.parse(fs.readFileSync(`${moduleDir}/locales/fi.json`, 'utf8')),
50
+ 'fil': JSON.parse(fs.readFileSync(`${moduleDir}/locales/fil.json`, 'utf8')),
51
+ 'fr': JSON.parse(fs.readFileSync(`${moduleDir}/locales/fr.json`, 'utf8')),
52
+ 'he': JSON.parse(fs.readFileSync(`${moduleDir}/locales/he.json`, 'utf8')),
53
+ 'hi': JSON.parse(fs.readFileSync(`${moduleDir}/locales/hi.json`, 'utf8')),
54
+ 'hr': JSON.parse(fs.readFileSync(`${moduleDir}/locales/hr.json`, 'utf8')),
55
+ 'hu': JSON.parse(fs.readFileSync(`${moduleDir}/locales/hu.json`, 'utf8')),
56
+ 'id': JSON.parse(fs.readFileSync(`${moduleDir}/locales/id.json`, 'utf8')),
57
+ 'it': JSON.parse(fs.readFileSync(`${moduleDir}/locales/it.json`, 'utf8')),
58
+ 'ja': JSON.parse(fs.readFileSync(`${moduleDir}/locales/ja.json`, 'utf8')),
59
+ 'ko': JSON.parse(fs.readFileSync(`${moduleDir}/locales/ko.json`, 'utf8')),
60
+ 'lt': JSON.parse(fs.readFileSync(`${moduleDir}/locales/lt.json`, 'utf8')),
61
+ 'lv': JSON.parse(fs.readFileSync(`${moduleDir}/locales/lv.json`, 'utf8')),
62
+ 'nl': JSON.parse(fs.readFileSync(`${moduleDir}/locales/nl.json`, 'utf8')),
63
+ 'no': JSON.parse(fs.readFileSync(`${moduleDir}/locales/no.json`, 'utf8')),
64
+ 'pl': JSON.parse(fs.readFileSync(`${moduleDir}/locales/pl.json`, 'utf8')),
65
+ 'pt': JSON.parse(fs.readFileSync(`${moduleDir}/locales/pt.json`, 'utf8')),
66
+ 'pt-PT': JSON.parse(fs.readFileSync(`${moduleDir}/locales/pt-PT.json`, 'utf8')),
67
+ 'ro': JSON.parse(fs.readFileSync(`${moduleDir}/locales/ro.json`, 'utf8')),
68
+ 'ru': JSON.parse(fs.readFileSync(`${moduleDir}/locales/ru.json`, 'utf8')),
69
+ 'sk': JSON.parse(fs.readFileSync(`${moduleDir}/locales/sk.json`, 'utf8')),
70
+ 'sl': JSON.parse(fs.readFileSync(`${moduleDir}/locales/sl.json`, 'utf8')),
71
+ 'sr': JSON.parse(fs.readFileSync(`${moduleDir}/locales/sr.json`, 'utf8')),
72
+ 'sr-Latn': JSON.parse(fs.readFileSync(`${moduleDir}/locales/sr-Latn.json`, 'utf8')),
73
+ 'sv': JSON.parse(fs.readFileSync(`${moduleDir}/locales/sv.json`, 'utf8')),
74
+ 'ta': JSON.parse(fs.readFileSync(`${moduleDir}/locales/ta.json`, 'utf8')),
75
+ 'te': JSON.parse(fs.readFileSync(`${moduleDir}/locales/te.json`, 'utf8')),
76
+ 'th': JSON.parse(fs.readFileSync(`${moduleDir}/locales/th.json`, 'utf8')),
77
+ 'tr': JSON.parse(fs.readFileSync(`${moduleDir}/locales/tr.json`, 'utf8')),
78
+ 'uk': JSON.parse(fs.readFileSync(`${moduleDir}/locales/uk.json`, 'utf8')),
79
+ 'vi': JSON.parse(fs.readFileSync(`${moduleDir}/locales/vi.json`, 'utf8')),
80
+ 'zh': JSON.parse(fs.readFileSync(`${moduleDir}/locales/zh.json`, 'utf8')),
81
+ 'zh-HK': JSON.parse(fs.readFileSync(`${moduleDir}/locales/zh-HK.json`, 'utf8')),
82
+ 'zh-TW': JSON.parse(fs.readFileSync(`${moduleDir}/locales/zh-TW.json`, 'utf8')),
83
+ };
84
+
76
85
  // The keys within this const must exactly match the LH.Locale type in externs.d.ts
77
86
  /** @type {Record<Locale, LhlMessages>} */
78
87
  const locales = {
79
- 'en-US': enUS, // The 'source' strings, with descriptions
80
- 'en': enUS, // According to CLDR/ICU, 'en' == 'en-US' dates/numbers (Why?!)
88
+ 'en-US': files['en-US'], // The 'source' strings, with descriptions
89
+ 'en': files['en-US'], // According to CLDR/ICU, 'en' == 'en-US' dates/numbers (Why?!)
81
90
 
82
91
  // TODO: en-GB has just ~10 messages that are different from en-US. We should only ship those.
83
- 'en-AU': enGB, // Alias of 'en-GB'
84
- 'en-GB': enGB, // Alias of 'en-GB'
85
- 'en-IE': enGB, // Alias of 'en-GB'
86
- 'en-SG': enGB, // Alias of 'en-GB'
87
- 'en-ZA': enGB, // Alias of 'en-GB'
88
- 'en-IN': enGB, // Alias of 'en-GB'
92
+ 'en-AU': files['en-GB'], // Alias of 'en-GB'
93
+ 'en-GB': files['en-GB'], // Alias of 'en-GB'
94
+ 'en-IE': files['en-GB'], // Alias of 'en-GB'
95
+ 'en-SG': files['en-GB'], // Alias of 'en-GB'
96
+ 'en-ZA': files['en-GB'], // Alias of 'en-GB'
97
+ 'en-IN': files['en-GB'], // Alias of 'en-GB'
89
98
 
90
99
  // All locales from here have a messages file, though we allow fallback to the base locale when the files are identical
91
- 'ar-XB': arXB, // psuedolocalization
92
- 'ar': ar,
93
- 'bg': bg,
94
- 'ca': ca,
95
- 'cs': cs,
96
- 'da': da,
97
- 'de': de, // de-AT, de-CH identical, so they fall back into de
98
- 'el': el,
99
- 'en-XA': enXA, // psuedolocalization
100
- 'en-XL': enXL, // local psuedolocalization
101
- 'es': es,
102
- 'es-419': es419,
100
+ 'ar-XB': files['ar-XB'], // psuedolocalization
101
+ 'ar': files['ar'],
102
+ 'bg': files['bg'],
103
+ 'ca': files['ca'],
104
+ 'cs': files['cs'],
105
+ 'da': files['da'],
106
+ 'de': files['de'], // de-AT, de-CH identical, so they fall back into de
107
+ 'el': files['el'],
108
+ 'en-XA': files['en-XA'], // psuedolocalization
109
+ 'en-XL': files['en-XL'], // local psuedolocalization
110
+ 'es': files['es'],
111
+ 'es-419': files['es-419'],
103
112
  // Aliases of es-419: https://raw.githubusercontent.com/unicode-cldr/cldr-core/master/supplemental/parentLocales.json
104
- 'es-AR': es419,
105
- 'es-BO': es419,
106
- 'es-BR': es419,
107
- 'es-BZ': es419,
108
- 'es-CL': es419,
109
- 'es-CO': es419,
110
- 'es-CR': es419,
111
- 'es-CU': es419,
112
- 'es-DO': es419,
113
- 'es-EC': es419,
114
- 'es-GT': es419,
115
- 'es-HN': es419,
116
- 'es-MX': es419,
117
- 'es-NI': es419,
118
- 'es-PA': es419,
119
- 'es-PE': es419,
120
- 'es-PR': es419,
121
- 'es-PY': es419,
122
- 'es-SV': es419,
123
- 'es-US': es419,
124
- 'es-UY': es419,
125
- 'es-VE': es419,
113
+ 'es-AR': files['es-419'],
114
+ 'es-BO': files['es-419'],
115
+ 'es-BR': files['es-419'],
116
+ 'es-BZ': files['es-419'],
117
+ 'es-CL': files['es-419'],
118
+ 'es-CO': files['es-419'],
119
+ 'es-CR': files['es-419'],
120
+ 'es-CU': files['es-419'],
121
+ 'es-DO': files['es-419'],
122
+ 'es-EC': files['es-419'],
123
+ 'es-GT': files['es-419'],
124
+ 'es-HN': files['es-419'],
125
+ 'es-MX': files['es-419'],
126
+ 'es-NI': files['es-419'],
127
+ 'es-PA': files['es-419'],
128
+ 'es-PE': files['es-419'],
129
+ 'es-PR': files['es-419'],
130
+ 'es-PY': files['es-419'],
131
+ 'es-SV': files['es-419'],
132
+ 'es-US': files['es-419'],
133
+ 'es-UY': files['es-419'],
134
+ 'es-VE': files['es-419'],
126
135
 
127
- 'fi': fi,
128
- 'fil': fil,
129
- 'fr': fr, // fr-CH identical, so it falls back into fr
130
- 'he': he,
131
- 'hi': hi,
132
- 'hr': hr,
133
- 'hu': hu,
134
- 'gsw': de, // swiss german. identical (for our purposes) to 'de'
135
- 'id': id,
136
- 'in': id, // Alias of 'id'
137
- 'it': it,
138
- 'iw': he, // Alias of 'he'
139
- 'ja': ja,
140
- 'ko': ko,
141
- 'lt': lt,
142
- 'lv': lv,
143
- 'mo': ro, // Alias of 'ro'
144
- 'nl': nl,
145
- 'nb': no, // Alias of 'no'
146
- 'no': no,
147
- 'pl': pl,
148
- 'pt': pt, // pt-BR identical, so it falls back into pt
149
- 'pt-PT': ptPT,
150
- 'ro': ro,
151
- 'ru': ru,
152
- 'sk': sk,
153
- 'sl': sl,
154
- 'sr': sr,
155
- 'sr-Latn': srLatn,
156
- 'sv': sv,
157
- 'ta': ta,
158
- 'te': te,
159
- 'th': th,
160
- 'tl': fil, // Alias of 'fil'
161
- 'tr': tr,
162
- 'uk': uk,
163
- 'vi': vi,
164
- 'zh': zh, // aka ZH-Hans, sometimes seen as zh-CN, zh-Hans-CN, Simplified Chinese
165
- 'zh-HK': zhHK, // aka zh-Hant-HK. Note: yue-Hant-HK is not supported.
166
- 'zh-TW': zhTW, // aka zh-Hant, zh-Hant-TW, Traditional Chinese
136
+ 'fi': files['fi'],
137
+ 'fil': files['fil'],
138
+ 'fr': files['fr'], // fr-CH identical, so it falls back into fr
139
+ 'he': files['he'],
140
+ 'hi': files['hi'],
141
+ 'hr': files['hr'],
142
+ 'hu': files['hu'],
143
+ 'gsw': files['de'], // swiss german. identical (for our purposes) to 'de'
144
+ 'id': files['id'],
145
+ 'in': files['id'], // Alias of 'id'
146
+ 'it': files['it'],
147
+ 'iw': files['he'], // Alias of 'he'
148
+ 'ja': files['ja'],
149
+ 'ko': files['ko'],
150
+ 'lt': files['lt'],
151
+ 'lv': files['lv'],
152
+ 'mo': files['ro'], // Alias of 'ro'
153
+ 'nl': files['nl'],
154
+ 'nb': files['no'], // Alias of 'no'
155
+ 'no': files['no'],
156
+ 'pl': files['pl'],
157
+ 'pt': files['pt'], // pt-BR identical, so it falls back into pt
158
+ 'pt-PT': files['pt-PT'],
159
+ 'ro': files['ro'],
160
+ 'ru': files['ru'],
161
+ 'sk': files['sk'],
162
+ 'sl': files['sl'],
163
+ 'sr': files['sr'],
164
+ 'sr-Latn': files['sr-Latn'],
165
+ 'sv': files['sv'],
166
+ 'ta': files['ta'],
167
+ 'te': files['te'],
168
+ 'th': files['th'],
169
+ 'tl': files['fil'], // Alias of 'fil'
170
+ 'tr': files['tr'],
171
+ 'uk': files['uk'],
172
+ 'vi': files['vi'],
173
+ 'zh': files['zh'], // aka ZH-Hans, sometimes seen as zh-CN, zh-Hans-CN, Simplified Chinese
174
+ 'zh-HK': files['zh-HK'], // aka zh-Hant-HK. Note: yue-Hant-HK is not supported.
175
+ 'zh-TW': files['zh-TW'], // aka zh-Hant, zh-Hant-TW, Traditional Chinese
167
176
  };
168
177
 
169
178
  export {locales};
@@ -6,14 +6,12 @@
6
6
  // Only include `@types/node` from node_modules/.
7
7
  "types": ["node"],
8
8
  // "listFiles": true,
9
- "resolveJsonModule": true,
10
9
  },
11
10
  "references": [
12
11
  {"path": "../types/lhr/"},
13
12
  ],
14
13
  "include": [
15
14
  "**/*.js",
16
- "**/*.json",
17
15
  "types/**/*.d.ts",
18
16
  ],
19
17
  "exclude": [
@@ -56,6 +56,7 @@ Array [
56
56
  "sharedDictionaryIssueDetails",
57
57
  "sriMessageSignatureIssueDetails",
58
58
  "stylesheetLoadingIssueDetails",
59
+ "unencodedDigestIssueDetails",
59
60
  "userReidentificationIssueDetails",
60
61
  ]
61
62
  `);
@@ -12,7 +12,7 @@
12
12
  "rootDir": ".",
13
13
 
14
14
  "target": "es2022",
15
- "module": "preserve",
15
+ "module": "es2022",
16
16
  "moduleResolution": "node",
17
17
  "esModuleInterop": true,
18
18
 
package/tsconfig.json CHANGED
@@ -25,7 +25,6 @@
25
25
  "core/test/fixtures/unresolved-perflog.json",
26
26
  "core/test/fixtures/traces/lcp-m78.devtools.log.json",
27
27
  "core/lib/legacy-javascript/polyfill-graph-data.json",
28
- "core/lib/legacy-javascript/polyfill-module-data.json",
29
28
  "shared/localization/locales/en-US.json",
30
29
  ],
31
30
  "exclude": [