function initializeSettings()

in src/node/main.ts [66:120]


function initializeSettings() {
	options = { locale: undefined, language: undefined, languagePackSupport: false, cacheLanguageResolution: true, messageFormat: MessageFormat.bundle };
	if (isString(process.env.VSCODE_NLS_CONFIG)) {
		try {
			let vscodeOptions = JSON.parse(process.env.VSCODE_NLS_CONFIG) as VSCodeNlsConfig;
			let language: string | undefined;
			if (vscodeOptions.availableLanguages) {
				let value = vscodeOptions.availableLanguages['*'];
				if (isString(value)) {
					language = value;
				}
			}
			if (isString(vscodeOptions.locale)) {
				options.locale = vscodeOptions.locale.toLowerCase();
			}
			if (language === undefined) {
				options.language = options.locale;
			} else if (language !== 'en') {
				options.language = language;
			}

			if (isBoolean(vscodeOptions._languagePackSupport)) {
				options.languagePackSupport = vscodeOptions._languagePackSupport;
			}
			if (isString(vscodeOptions._cacheRoot)) {
				options.cacheRoot = vscodeOptions._cacheRoot;
			}
			if (isString(vscodeOptions._languagePackId)) {
				options.languagePackId = vscodeOptions._languagePackId;
			}
			if (isString(vscodeOptions._translationsConfigFile)) {
				options.translationsConfigFile = vscodeOptions._translationsConfigFile;
				try {
					options.translationsConfig = readJsonFileSync(options.translationsConfigFile);
				} catch (error) {
					// We can't read the translation config file. Mark the cache as corrupted.
					if (vscodeOptions._corruptedFile) {
						const dirname = path.dirname(vscodeOptions._corruptedFile);
						fs.exists(dirname, (exists) => {
							if (exists) {
								fs.writeFile(vscodeOptions._corruptedFile, 'corrupted', 'utf8', (err) => {
									console.error(err);
								});
							}
						});
					}
				}
			}
		} catch {
			// Do nothing.
		}
	}
	setPseudo(options.locale === 'pseudo');
	resolvedBundles = Object.create(null);
}