Skip to content

Commit

Permalink
fix: 🐛 fix the extension language source
Browse files Browse the repository at this point in the history
extension language now follows the app language instead of the system language
  • Loading branch information
vivaxy committed Feb 23, 2021
1 parent 11f7246 commit 2909708
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
6 changes: 1 addition & 5 deletions src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,8 @@ import CommitProvider from './lib/editor/provider';

export function activate(context: vscode.ExtensionContext) {
output.initialize();
localize.initialize();
output.appendLine('Activated');
output.appendLine(
'process.env.VSCODE_NLS_CONFIG: ' + process.env.VSCODE_NLS_CONFIG,
);
output.appendLine('vscode.env.language: ' + vscode.env.language);
localize.initialize();
const disposable = vscode.commands.registerCommand(
'extension.conventionalCommits',
createConventionalCommits(),
Expand Down
12 changes: 8 additions & 4 deletions src/lib/localize.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,20 @@
* @author vivaxy
*/
import * as path from 'path';
// import * as vscode from 'vscode';
import * as vscode from 'vscode';

import * as output from './output';

export let locale: string = '';
let defaultNLS: Record<string, string> = {};
let localeNLS: Record<string, string> = {};

function getLocale() {
const config = JSON.parse(process.env.VSCODE_NLS_CONFIG!);
return config.locale;
// return vscode.env.language;
// const config = JSON.parse(process.env.VSCODE_NLS_CONFIG!);
// return config.locale;
const language = vscode.env.language;
output.appendLine('vscode.env.language: ' + language);
return language;
}

export function initialize() {
Expand Down

0 comments on commit 2909708

Please sign in to comment.