Skip to content

Commit

Permalink
Pass Culture from VSCode to .NET kernel process
Browse files Browse the repository at this point in the history
  • Loading branch information
ocalles committed Jun 28, 2023
1 parent fa7cfb0 commit 2df0c33
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/polyglot-notebooks-vscode-common/src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,8 @@ export async function activate(context: vscode.ExtensionContext) {

const workspaceFolderUris = vscode.workspace.workspaceFolders?.map(folder => folder.uri) || [];
const workingDirectory = getWorkingDirectoryForNotebook(notebookUri, workspaceFolderUris, fallbackWorkingDirectory);
const environmentVariables = polyglotConfig.get<{ [key: string]: string }>('kernelEnvironmentVariables');
const environmentVariables = { ...polyglotConfig.get<{ [key: string]: string }>('kernelEnvironmentVariables'), 'DOTNET_CLI_CULTURE': getCurrentCulture(), 'DOTNET_CLI_UI_LANGUAGE': getCurrentCulture() };

const processStart = processArguments(argsTemplate, workingDirectory, DotNetPathManager.getDotNetPath(), launchOptions!.workingDirectory, environmentVariables);
let notification = {
displayError: async (message: string) => { await vscode.window.showErrorMessage(message, { modal: false }); },
Expand All @@ -157,6 +158,11 @@ export async function activate(context: vscode.ExtensionContext) {
};
}

function getCurrentCulture(): string {
return vscode.env.language;
}


function configureKernel(compositeKernel: CompositeKernel, notebookUri: vscodeLike.Uri) {
compositeKernel.setDefaultTargetKernelNameForCommand(commandsAndEvents.RequestInputType, compositeKernel.name);
compositeKernel.setDefaultTargetKernelNameForCommand(commandsAndEvents.SendEditableCodeType, compositeKernel.name);
Expand Down

0 comments on commit 2df0c33

Please sign in to comment.