Skip to content

Commit 6675ac2

Browse files
committed
Always use en-US as locale when creating status reporter
1 parent 220ee81 commit 6675ac2

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

src/compiler/tsbuild.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -314,9 +314,12 @@ namespace ts {
314314
/**
315315
* Create a function that reports watch status by writing to the system and handles the formating of the diagnostic
316316
*/
317-
export function createBuilderStatusReporter(system: System, pretty?: boolean): DiagnosticReporter {
317+
export function createBuilderStatusReporter(system: System, pretty?: boolean): DiagnosticReporter;
318+
/*@internal*/
319+
export function createBuilderStatusReporter(system: System, pretty?: boolean, locale?: string): DiagnosticReporter; // eslint-disable-line @typescript-eslint/unified-signatures
320+
export function createBuilderStatusReporter(system: System, pretty?: boolean, locale?: string): DiagnosticReporter {
318321
return diagnostic => {
319-
let output = pretty ? `[${formatColorAndReset((system.now ? system.now() : new Date()).toLocaleTimeString(), ForegroundColorEscapeSequences.Grey)}] ` : `${(system.now ? system.now() : new Date()).toLocaleTimeString()} - `;
322+
let output = pretty ? `[${formatColorAndReset((system.now ? system.now() : new Date()).toLocaleTimeString(locale), ForegroundColorEscapeSequences.Grey)}] ` : `${(system.now ? system.now() : new Date()).toLocaleTimeString(locale)} - `;
320323
output += `${flattenDiagnosticMessageText(diagnostic.messageText, system.newLine)}${system.newLine + system.newLine}`;
321324
system.write(output);
322325
};

src/testRunner/unittests/tsc/helpers.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ namespace ts {
130130
sys,
131131
/*createProgram*/ undefined,
132132
reportDiagnostic,
133-
createBuilderStatusReporter(sys, buildOptions.pretty),
133+
createBuilderStatusReporter(sys, buildOptions.pretty, "en-US"),
134134
createReportErrorSummary(sys, buildOptions)
135135
);
136136
fakes.patchSolutionBuilderHost(buildHost, sys);

0 commit comments

Comments
 (0)