From 1479efdefa6e7fffc257b035024ea577c68a0f5f Mon Sep 17 00:00:00 2001 From: Shen Chen Date: Tue, 29 Oct 2024 21:59:19 -0700 Subject: [PATCH 1/3] Localize LSP Trace Logs --- l10n/bundle.l10n.json | 1 + src/lsptoolshost/roslynLanguageServer.ts | 3 +-- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/l10n/bundle.l10n.json b/l10n/bundle.l10n.json index 64885d6e5..f5ae5371a 100644 --- a/l10n/bundle.l10n.json +++ b/l10n/bundle.l10n.json @@ -168,6 +168,7 @@ "IntelliCode features will not be available, {0} failed to activate.": "IntelliCode features will not be available, {0} failed to activate.", "Go to output": "Go to output", "Suppress notification": "Suppress notification", + "C# LSP Trace Logs": "C# LSP Trace Logs", "Restore {0}": "Restore {0}", "Restore already in progress": "Restore already in progress", "Sending request": "Sending request", diff --git a/src/lsptoolshost/roslynLanguageServer.ts b/src/lsptoolshost/roslynLanguageServer.ts index 9e7adf6b2..cab2463f8 100644 --- a/src/lsptoolshost/roslynLanguageServer.ts +++ b/src/lsptoolshost/roslynLanguageServer.ts @@ -1069,8 +1069,7 @@ export async function activateRoslynLanguageServer( // Create a channel for outputting general logs from the language server. _channel = outputChannel; // Create a separate channel for outputting trace logs - these are incredibly verbose and make other logs very difficult to see. - // The trace channel verbosity is controlled by the _channel verbosity. - _traceChannel = vscode.window.createOutputChannel('C# LSP Trace Logs'); + _traceChannel = vscode.window.createOutputChannel(vscode.l10n.t('C# LSP Trace Logs')); const hostExecutableResolver = new DotnetRuntimeExtensionResolver( platformInfo, From da2c4d20f033ca1aa270e81483e4901ac509cf54 Mon Sep 17 00:00:00 2001 From: Shen Chen Date: Mon, 4 Nov 2024 15:22:57 -0800 Subject: [PATCH 2/3] Localizae other output channel --- l10n/bundle.l10n.json | 4 ++++ src/lsptoolshost/restore.ts | 2 +- src/lsptoolshost/roslynLanguageServer.ts | 1 + src/lsptoolshost/unitTesting.ts | 2 +- src/main.ts | 4 ++-- src/omnisharp/omnisharpLanguageServer.ts | 2 +- src/shared/processPicker.ts | 2 +- 7 files changed, 11 insertions(+), 6 deletions(-) diff --git a/l10n/bundle.l10n.json b/l10n/bundle.l10n.json index f5ae5371a..e504aad2b 100644 --- a/l10n/bundle.l10n.json +++ b/l10n/bundle.l10n.json @@ -1,4 +1,6 @@ { + ".NET Test Log": ".NET Test Log", + ".NET NuGet Restore": ".NET NuGet Restore", "How to setup Remote Debugging": "How to setup Remote Debugging", "The C# extension for Visual Studio Code is incompatible on {0} {1} with the VS Code Remote Extensions. To see avaliable workarounds, click on '{2}'.": "The C# extension for Visual Studio Code is incompatible on {0} {1} with the VS Code Remote Extensions. To see avaliable workarounds, click on '{2}'.", "The C# extension for Visual Studio Code is incompatible on {0} {1}.": "The C# extension for Visual Studio Code is incompatible on {0} {1}.", @@ -7,6 +9,7 @@ "Cannot create .NET debug configurations. The active C# project is not within folder '{0}'.": "Cannot create .NET debug configurations. The active C# project is not within folder '{0}'.", "Does not contain .NET Core projects.": "Does not contain .NET Core projects.", "pipeArgs must be a string or a string array type": "pipeArgs must be a string or a string array type", + "remote-attach": "remote-attach", "Name not defined in current configuration.": "Name not defined in current configuration.", "Configuration \"{0}\" in launch.json does not have a {1} argument with {2} for remote process listing.": "Configuration \"{0}\" in launch.json does not have a {1} argument with {2} for remote process listing.", "Select the process to attach to": "Select the process to attach to", @@ -145,6 +148,7 @@ "dotnet.server.useOmnisharp option has changed. Please reload the window to apply the change": "dotnet.server.useOmnisharp option has changed. Please reload the window to apply the change", "C# configuration has changed. Would you like to relaunch the Language Server with your changes?": "C# configuration has changed. Would you like to relaunch the Language Server with your changes?", "Restart Language Server": "Restart Language Server", + "OmniSharp Log": "OmniSharp Log", "project.json is no longer a supported project format for .NET Core applications.": "project.json is no longer a supported project format for .NET Core applications.", "More Detail": "More Detail", "Some projects have trouble loading. Please review the output for more details.": "Some projects have trouble loading. Please review the output for more details.", diff --git a/src/lsptoolshost/restore.ts b/src/lsptoolshost/restore.ts index 5153becaa..78f0e18c8 100644 --- a/src/lsptoolshost/restore.ts +++ b/src/lsptoolshost/restore.ts @@ -23,7 +23,7 @@ export function registerRestoreCommands(context: vscode.ExtensionContext, langua // We do not need to register restore commands if using C# devkit. return; } - const restoreChannel = vscode.window.createOutputChannel('.NET NuGet Restore'); + const restoreChannel = vscode.window.createOutputChannel(vscode.l10n.t('.NET NuGet Restore')); context.subscriptions.push( vscode.commands.registerCommand('dotnet.restore.project', async (_request): Promise => { return chooseProjectAndRestore(languageServer, restoreChannel); diff --git a/src/lsptoolshost/roslynLanguageServer.ts b/src/lsptoolshost/roslynLanguageServer.ts index cab2463f8..1ca6ea1d6 100644 --- a/src/lsptoolshost/roslynLanguageServer.ts +++ b/src/lsptoolshost/roslynLanguageServer.ts @@ -1069,6 +1069,7 @@ export async function activateRoslynLanguageServer( // Create a channel for outputting general logs from the language server. _channel = outputChannel; // Create a separate channel for outputting trace logs - these are incredibly verbose and make other logs very difficult to see. + // The trace channel verbosity is controlled by the _channel verbosity. _traceChannel = vscode.window.createOutputChannel(vscode.l10n.t('C# LSP Trace Logs')); const hostExecutableResolver = new DotnetRuntimeExtensionResolver( diff --git a/src/lsptoolshost/unitTesting.ts b/src/lsptoolshost/unitTesting.ts index 956be85fc..24e812c65 100644 --- a/src/lsptoolshost/unitTesting.ts +++ b/src/lsptoolshost/unitTesting.ts @@ -19,7 +19,7 @@ export function registerUnitTestingCommands(context: vscode.ExtensionContext, la // If using C# devkit, we don't need to register any test commands. return; } - const dotnetTestChannel = vscode.window.createOutputChannel('.NET Test Log'); + const dotnetTestChannel = vscode.window.createOutputChannel(vscode.l10n.t('.NET Test Log')); context.subscriptions.push( vscode.commands.registerCommand( 'dotnet.test.run', diff --git a/src/main.ts b/src/main.ts index 1f7eaa7f8..e928493e8 100644 --- a/src/main.ts +++ b/src/main.ts @@ -144,8 +144,8 @@ export async function activate( ); } else { // activate language services - const dotnetTestChannel = vscode.window.createOutputChannel('.NET Test Log'); - const dotnetChannel = vscode.window.createOutputChannel('.NET NuGet Restore'); + const dotnetTestChannel = vscode.window.createOutputChannel(vscode.l10n.t('.NET Test Log')); + const dotnetChannel = vscode.window.createOutputChannel(vscode.l10n.t('.NET NuGet Restore')); omnisharpLangServicePromise = activateOmniSharpLanguageServer( context, platformInfo, diff --git a/src/omnisharp/omnisharpLanguageServer.ts b/src/omnisharp/omnisharpLanguageServer.ts index 9fa3399b3..0d625b770 100644 --- a/src/omnisharp/omnisharpLanguageServer.ts +++ b/src/omnisharp/omnisharpLanguageServer.ts @@ -89,7 +89,7 @@ export async function activateOmniSharpLanguageServer( eventStream.subscribe(dotnetTestChannelObserver.post); eventStream.subscribe(dotnetTestLoggerObserver.post); - const omnisharpChannel = vscode.window.createOutputChannel('OmniSharp Log'); + const omnisharpChannel = vscode.window.createOutputChannel(vscode.l10n.t('OmniSharp Log')); const omnisharpLogObserver = new OmnisharpLoggerObserver(omnisharpChannel, platformInfo); const omnisharpChannelObserver = new OmnisharpChannelObserver(omnisharpChannel); eventStream.subscribe(omnisharpLogObserver.post); diff --git a/src/shared/processPicker.ts b/src/shared/processPicker.ts index 78ff23dd6..87edaa53a 100644 --- a/src/shared/processPicker.ts +++ b/src/shared/processPicker.ts @@ -222,7 +222,7 @@ export class RemoteAttachPicker { ): Promise { // Create remote attach output channel for errors. if (RemoteAttachPicker._channel === undefined) { - RemoteAttachPicker._channel = vscode.window.createOutputChannel('remote-attach'); + RemoteAttachPicker._channel = vscode.window.createOutputChannel(vscode.l10n.t('remote-attach')); } else { RemoteAttachPicker._channel.clear(); } From 05241f7fc0ddc81816605fbfc7d09e1bf5f6e493 Mon Sep 17 00:00:00 2001 From: Shen Chen Date: Mon, 4 Nov 2024 15:51:00 -0800 Subject: [PATCH 3/3] Localize razor --- src/razor/src/razorLogger.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/razor/src/razorLogger.ts b/src/razor/src/razorLogger.ts index 4f4624c23..7d685834b 100644 --- a/src/razor/src/razorLogger.ts +++ b/src/razor/src/razorLogger.ts @@ -25,7 +25,7 @@ export class RazorLogger implements vscodeAdapter.Disposable { this.onLogEmitter = eventEmitterFactory.create(); this.onTraceLevelChangeEmitter = eventEmitterFactory.create(); - this.outputChannel = vscode.window.createOutputChannel(RazorLogger.logName); + this.outputChannel = vscode.window.createOutputChannel(vscode.l10n.t('Razor Log')); this.logRazorInformation(); this.setupToStringOverrides();