提交 74de3be4 编写于 作者: D Dirk Baeumer

Read locale information from environment

上级 5f331684
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册