From cb111be8cc41ee42a1ec5ef036308990f9005fdd Mon Sep 17 00:00:00 2001 From: Rob Lourens Date: Mon, 25 Sep 2017 09:38:17 -0700 Subject: [PATCH] Respect locale passed through 'initialize' call for Microsoft/vscode-debugadapter-node#129 --- package.json | 4 ++-- src/chrome/chromeDebugAdapter.ts | 6 +++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index f25d21cd8..a61bce63a 100644 --- a/package.json +++ b/package.json @@ -17,8 +17,8 @@ "noice-json-rpc": "1.0.1", "request-light": "^0.1.0", "source-map": "^0.5.6", - "vscode-debugadapter": "^1.24.0-pre.1", - "vscode-debugprotocol": "^1.24.0-pre.0", + "vscode-debugadapter": "^1.24.0", + "vscode-debugprotocol": "^1.24.0", "vscode-nls": "^2.0.2", "ws": "^1.1.1" }, diff --git a/src/chrome/chromeDebugAdapter.ts b/src/chrome/chromeDebugAdapter.ts index e47e6a00c..9693233a8 100644 --- a/src/chrome/chromeDebugAdapter.ts +++ b/src/chrome/chromeDebugAdapter.ts @@ -32,7 +32,7 @@ import {EagerSourceMapTransformer} from '../transformers/eagerSourceMapTransform import * as path from 'path'; import * as nls from 'vscode-nls'; -const localize = nls.config(process.env.VSCODE_NLS_CONFIG)(); +let localize = nls.config(process.env.VSCODE_NLS_CONFIG)(); interface IPropCount { indexedVariables: number; @@ -188,6 +188,10 @@ export abstract class ChromeDebugAdapter implements IDebugAdapter { throw errors.pathFormat(); } + if (args.locale) { + localize = nls.config({ locale: args.locale })(); + } + // because session bypasses dispatchRequest if (typeof args.linesStartAt1 === 'boolean') { (this)._clientLinesStartAt1 = args.linesStartAt1;