mirror of
https://github.com/microsoft/vscode.git
synced 2026-07-08 23:32:36 -05:00
Read locale information from environment
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user