提交 ff87c6b4 编写于 作者: D Dirk Baeumer

Fixes #3841: Accessibility: Support exposing current language to screen readers

上级 235cbcdf
......@@ -113,8 +113,20 @@
process.env['VSCODE_SHARED_IPC_HOOK'] = configuration.sharedIPCHandle;
// Get the nls configuration into the process.env as early as possible.
var nlsConfig = { availableLanguages: {} };
if (configuration.userEnv && configuration.userEnv['VSCODE_NLS_CONFIG']) {
process.env['VSCODE_NLS_CONFIG'] = configuration.userEnv['VSCODE_NLS_CONFIG'];
var config = configuration.userEnv['VSCODE_NLS_CONFIG'];
process.env['VSCODE_NLS_CONFIG'] = config;
try {
if (config) {
nlsConfig = JSON.parse(config);
}
} catch (e) {
}
}
var uiLanguage = nlsConfig.availableLanguages['*'];
if (uiLanguage) {
window.document.getElementsByTagName('html')[0].setAttribute('lang', uiLanguage)
}
registerListeners(enableDeveloperTools);
......@@ -144,17 +156,6 @@
// 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;
try {
var config = process.env['VSCODE_NLS_CONFIG'];
if (config) {
nlsConfig = JSON.parse(config);
}
} catch (e) {
}
if (!nlsConfig) {
nlsConfig = { availableLanguages: {} };
}
require.config({
baseUrl: rootUrl,
'vs/nls': nlsConfig,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册