Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 13 additions & 3 deletions src/client/common/utils/localizeHelpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,19 @@ function parseLocale(): string {
} catch {
// Fall through
}
// Attempt to load from the vscode locale. If not there, use english
const vscodeConfigString = process.env.VSCODE_NLS_CONFIG;
return vscodeConfigString ? JSON.parse(vscodeConfigString).locale : 'en-us';

try {
// Attempt to load from the vscode locale. If not there, use english
// 'process' should be in this `try` block for browser support.
// Don't merge this try block with the one above. They have to fall
// through in this order.
const vscodeConfigString = process.env.VSCODE_NLS_CONFIG;
return vscodeConfigString ? JSON.parse(vscodeConfigString).locale : 'en-us';
} catch {
// Fall through
}

return 'en-us';
}

export function getLocalizedString(key: string, defValue?: string): string {
Expand Down