Read locale information from environment

This commit is contained in:
Dirk Baeumer
2016-03-03 15:06:26 +01:00
parent 5f33168479
commit 74de3be44d
2 changed files with 20 additions and 2 deletions

View File

@@ -164,7 +164,17 @@
// In the bundled version the nls plugin is packaged with the loader so the NLS Plugins
// loads as soon as the loader loads. To be able to have pseudo translation
createScript(rootUrl + '/vs/loader.js', function() {
var nlsConfig = getNlsPluginConfiguration(configuration);
var nlsConfig;
try {
var config = process.env['VSCODE_NLS_CONFIG'];
if (config) {
nlsConfig = JSON.parse(config);
}
} catch (e) {
}
if (!nlsConfig) {
nlsConfig = getNlsPluginConfiguration(configuration);
}
require.config({
baseUrl: rootUrl,
'vs/nls': nlsConfig,

View File

@@ -50,7 +50,15 @@ export function startup(environment: IMainEnvironment, globalSettings: IGlobalSe
};
// Inherit navigator language
environment.language = navigator.language;
let language = navigator.language;
try {
var config = process.env['VSCODE_NLS_CONFIG'];
if (config) {
language = JSON.parse(config).locale;
}
} catch (e) {
}
environment.language = language;
// Shell Options
let filesToOpen = environment.filesToOpen && environment.filesToOpen.length ? toInputs(environment.filesToOpen) : null;