()
| 40 | } |
| 41 | |
| 42 | export 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 | |
| 59 | export function getLocalizedHtmlPath(originalPath: string): string { |
| 60 | const locale: string = getLocaleId(); |
no outgoing calls
no test coverage detected