MCPcopy Index your code
hub / github.com/microsoft/vscode-cpptools / getLocaleId

Function getLocaleId

Extension/src/LanguageServer/localization.ts:42–57  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

40}
41
42export function getLocaleId(): string {
43 // This replicates the language detection used by initializeSettings() in vscode-nls
44 if (typeof process.env.VSCODE_NLS_CONFIG === 'string') {
45 const vscodeOptions: VSCodeNlsConfig = JSON.parse(process.env.VSCODE_NLS_CONFIG) as VSCodeNlsConfig;
46 if (vscodeOptions.availableLanguages) {
47 const value: any = vscodeOptions.availableLanguages['*'];
48 if (typeof value === 'string') {
49 return value;
50 }
51 }
52 if (typeof vscodeOptions.locale === 'string') {
53 return vscodeOptions.locale.toLowerCase();
54 }
55 }
56 return "en";
57}
58
59export function getLocalizedHtmlPath(originalPath: string): string {
60 const locale: string = getLocaleId();

Callers 4

createLanguageClientMethod · 0.90
onCopilotHoverFunction · 0.90
getLocalizedHtmlPathFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected