@@ -53,69 +53,22 @@ function main(): void {
5353
5454 // Create i18n mock
5555 const i18nDir = path . join ( BUILD_DIR , devtoolsFrontEndCorePath , 'i18n' ) ;
56- fs . mkdirSync ( i18nDir , { recursive : true } ) ;
57- const i18nFile = path . join ( i18nDir , 'i18n.js' ) ;
58- const i18nContent = `
59- export const i18n = {
60- registerUIStrings: () => {},
61- getLocalizedString: (_, str) => {
62- // So that the string passed in gets output verbatim.
63- return str;
64- },
65- lockedLazyString: () => {},
66- getLazilyComputedLocalizedString: () => ()=>{},
67- };
68-
69- // TODO(jacktfranklin): once the DocumentLatency insight does not depend on
70- // this method, we can remove this stub.
71- export const TimeUtilities = {
72- millisToString(x) {
73- const separator = '\xA0';
74- const formatter = new Intl.NumberFormat('en-US', {
75- style: 'unit',
76- unitDisplay: 'narrow',
77- minimumFractionDigits: 0,
78- maximumFractionDigits: 1,
79- unit: 'millisecond',
80- });
81-
82- const parts = formatter.formatToParts(x);
83- for (const part of parts) {
84- if (part.type === 'literal') {
85- if (part.value === ' ') {
86- part.value = separator;
87- }
88- }
89- }
56+ const localesFile = path . join ( i18nDir , 'locales.js' ) ;
57+ const localesContent = `
58+ export const LOCALES = [
59+ 'en-US',
60+ ];
9061
91- return parts.map(part => part.value).join('');
92- }
93- };
94-
95- // TODO(jacktfranklin): once the ImageDelivery insight does not depend on this method, we can remove this stub.
96- export const ByteUtilities = {
97- bytesToString(x) {
98- const separator = '\xA0';
99- const formatter = new Intl.NumberFormat('en-US', {
100- style: 'unit',
101- unit: 'kilobyte',
102- unitDisplay: 'narrow',
103- minimumFractionDigits: 1,
104- maximumFractionDigits: 1,
105- });
106- const parts = formatter.formatToParts(x / 1000);
107- for (const part of parts) {
108- if (part.type === 'literal') {
109- if (part.value === ' ') {
110- part.value = separator;
111- }
112- }
113- }
62+ export const BUNDLED_LOCALES = [
63+ 'en-US',
64+ ];
11465
115- return parts.map(part => part.value).join('');
116- }
117- };` ;
118- writeFile ( i18nFile , i18nContent ) ;
66+ export const DEFAULT_LOCALE = 'en-US';
67+
68+ export const REMOTE_FETCH_PATTERN = '@HOST@/remote/serve_file/@VERSION@/core/i18n/locales/@LOCALE@.json';
69+
70+ export const LOCAL_FETCH_PATTERN = './locales/@LOCALE@.json';` ;
71+ writeFile ( localesFile , localesContent ) ;
11972
12073 // Create codemirror.next mock.
12174 const codeMirrorDir = path . join (
0 commit comments