src/vs/nls.ts

244 LOC · 226 covered · 18 uncovered · 20 ranges · 20961 concepts · 7 introducers · 12741 tests

File neighbourhood

The centred file is linked to every concept that introduces one of its ranges, every test that runs code from the file, and the gray connector concepts standing between those tests and the file's own introducer concepts. Undirected links join concepts to every file where they introduce source and concepts to the tests they introduce; arrows show specialization between the displayed concepts and bridge only concepts omitted from this view. Concept colors match the source ranges below; connector concepts have no source color and are shown in gray.

Focused file, its introducer and connector concepts, their introduced files, and tests that run code from the file

In the embedded map, ordinary wheel input scrolls the page; use the visible controls to zoom and drag to pan. Open the full-screen map for canvas navigation: wheel pans, Ctrl/Command plus wheel zooms, and arrow keys pan when this region is focused. On touch screens, open the full-screen map to pan or pinch. If JavaScript or WebGL is unavailable, use the related-file, concept, and source links on this page.

Focused file, its introducer and connector concepts, their introduced files, and tests that run code from the filesrc/vs/base/common/arrays.ts · 949 LOCcommon/arrays.tssrc/vs/base/common/arraysFind.ts · 226 LOCcommon/arraysFind.tssrc/vs/base/common/assert.ts · 91 LOCcommon/assert.tssrc/vs/base/common/charCode.ts · 450 LOCcommon/charCode.tssrc/vs/base/common/collections.ts · 176 LOCcommon/collections.tssrc/vs/base/common/errors.ts · 357 LOCcommon/errors.tssrc/vs/base/common/functional.ts · 32 LOCcommon/functional.tssrc/vs/base/common/iterator.ts · 194 LOCcommon/iterator.tssrc/vs/base/common/lifecycle.ts · 974 LOCcommon/lifecycle.tssrc/vs/base/common/map.ts · 1016 LOCcommon/map.tssrc/vs/base/common/marshallingIds.ts · 33 LOCcommon/marshallingIds.tssrc/vs/base/common/path.ts · 1589 LOCcommon/path.tssrc/vs/base/common/platform.ts · 281 LOCcommon/platform.tssrc/vs/base/common/process.ts · 76 LOCcommon/process.tssrc/vs/base/common/types.ts · 410 LOCcommon/types.tssrc/vs/base/common/uri.ts · 754 LOCcommon/uri.tssrc/vs/base/test/common/utils.ts · 107 LOCcommon/utils.tstaskConfiguration.ts ×3 · 9 introduced LOCtaskConfiguration.ts ×3taskConfiguration.ts ×1 · 3 introduced LOCtaskConfiguration.ts ×1taskConfiguration.ts ×2 · 3 introduced LOCtaskConfiguration.ts ×2chatExternalPathConfirmation.ts ×2 · 11 introduced LOCchatExternalPathConfirma…agentHostDiscardChangesOperationHandler.ts ×1 · 2 introduced LOCagentHostDiscardChangesO…agentHostSyncOperationProvider.ts ×1 · 9 introduced LOCagentHostSyncOperationPr…sshRemoteAgentHostService.ts ×1 · 2 introduced LOCsshRemoteAgentHostServic…viewLineRenderer.ts ×3 · 11 introduced LOCviewLineRenderer.ts ×3extensionNls.ts ×1 · 5 introduced LOCextensionNls.ts ×1copilotToolDisplay.ts ×2 · 4 introduced LOCcopilotToolDisplay.ts ×2copilotToolDisplay.ts ×2 · 4 introduced LOCcopilotToolDisplay.ts ×2copilotToolDisplay.ts ×2 · 4 introduced LOCcopilotToolDisplay.ts ×2copilotToolDisplay.test|title=sql tool display falls back to generic SQL wording when description is absent|occurrence=1 · 0 introduced LOCcopilotToolDisplay.test|…copilotToolDisplay.ts ×1 · 2 introduced LOCcopilotToolDisplay.ts ×1copilotToolDisplay.ts ×1 · 2 introduced LOCcopilotToolDisplay.ts ×1copilotToolDisplay.ts ×1 · 2 introduced LOCcopilotToolDisplay.ts ×1copilotToolDisplay.ts ×1 · 2 introduced LOCcopilotToolDisplay.ts ×1copilotToolDisplay.ts ×1 · 2 introduced LOCcopilotToolDisplay.ts ×1copilotToolDisplay.ts ×1 · 2 introduced LOCcopilotToolDisplay.ts ×1copilotToolDisplay.ts ×1 · 2 introduced LOCcopilotToolDisplay.ts ×1copilotToolDisplay.ts ×1 · 2 introduced LOCcopilotToolDisplay.ts ×1claudeInteractiveTools.ts ×1 · 15 introduced LOCclaudeInteractiveTools.t…undoRedoService.ts ×43 · 176 introduced LOCundoRedoService.ts ×43chatVariableEntries.ts ×2 · 5 introduced LOCchatVariableEntries.ts ×…instantiationServiceMock.ts ×3 · 6 introduced LOCinstantiationServiceMock…agentFeedbackServerTools.ts ×4 · 10 introduced LOCagentFeedbackServerTools…nls.ts ×2 · 13 introduced LOCnls.ts ×2markerService.ts ×1 · 1 introduced LOCmarkerService.ts ×1markerService.ts ×5 · 38 introduced LOCmarkerService.ts ×5environmentService.ts ×3 · 12 introduced LOCenvironmentService.ts ×3claudeBuiltinCommands.ts ×1 · 6 introduced LOCclaudeBuiltinCommands.ts…yaml.ts ×3 · 12 introduced LOCyaml.ts ×3yaml.ts ×1 · 7 introduced LOCyaml.ts ×1yaml.ts ×1 · 2 introduced LOCyaml.ts ×1date.ts ×1 · 2 introduced LOCdate.ts ×1updateUtils.ts ×1 · 2 introduced LOCupdateUtils.ts ×1updateUtils.ts ×1 · 1 introduced LOCupdateUtils.ts ×1date.ts ×1 · 2 introduced LOCdate.ts ×1date.ts ×1 · 2 introduced LOCdate.ts ×1date.ts ×1 · 10 introduced LOCdate.ts ×1nls.ts ×1 · 2 introduced LOCnls.ts ×1nls.ts ×1 · 1 introduced LOCnls.ts ×1nls.ts ×3 · 9 introduced LOCnls.ts ×3nls.ts ×1 · 1 introduced LOCnls.ts ×1nls.ts ×6 · 13 introduced LOCnls.ts ×6map.ts ×97 · 3334 introduced LOCmap.ts ×97date.test|title=Date fromNow disallowNow|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/base/test/common/date.test|title=Date fromNow disallowNow|occurrence=1date.test|title=Date fro…date.test|title=Date fromNowByDay today|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/base/test/common/date.test|title=Date fromNowByDay today|occurrence=1date.test|title=Date fro…date.test|title=Date fromNowByDay yesterday|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/base/test/common/date.test|title=Date fromNowByDay yesterday|occurrence=1date.test|title=Date fro…yaml.test|title=YAML Parser Error handling duplicate keys emit errors|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/base/test/common/yaml.test|title=YAML Parser Error handling duplicate keys emit errors|occurrence=1yaml.test|title=YAML Par…yaml.test|title=YAML Parser Old test suite duplicate keys emit error|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/base/test/common/yaml.test|title=YAML Parser Old test suite duplicate keys emit error|occurrence=1yaml.test|title=YAML Par…yaml.test|title=YAML Parser Old test suite unexpected indentation with recovery|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/base/test/common/yaml.test|title=YAML Parser Old test suite unexpected indentation with recovery|occurrence=1yaml.test|title=YAML Par…viewLineRenderer.test|title=renderViewLine overflow|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/editor/test/common/viewLayout/viewLineRenderer.test|title=renderViewLine overflow|occurrence=1viewLineRenderer.test|ti…agentHostDiscardChangesOperationHandler.test|title=AgentHostDiscardChangesOperationHandler restores the targeted file on success|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/agentHost/test/node/agentHostDiscardChangesOperationHandler.test|title=AgentHostDiscardChangesOperationHandler restores the targeted file on success|occurrence=1agentHostDiscardChangesO…agentHostSyncOperationProvider.test|title=AgentHostSyncOperationContribution advertises sync when there are outgoing changes|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/agentHost/test/node/agentHostSyncOperationProvider.test|title=AgentHostSyncOperationContribution advertises sync when there are outgoing changes|occurrence=1agentHostSyncOperationPr…claudeInteractiveTools.test|title=claudeInteractiveTools buildExitPlanModeConfirmationState falls back to empty plan when input.plan is missing or wrong-typed|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/agentHost/test/node/claudeInteractiveTools.test|title=claudeInteractiveTools buildExitPlanModeConfirmationState falls back to empty plan when input.plan is missing or wrong-typed|occurrence=1claudeInteractiveTools.t…Deny buttons|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/agentHost/test/node/claudeInteractiveTools.test|title=claudeInteractiveTools buildExitPlanModeConfirmationState renders the plan markdown body and Approve/Deny buttons|occurrence=1Deny buttons|occurrence=…copilotToolDisplay.test|title=apply_patch tool display falls back to a generic message when the patch body is missing or unparseable|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/agentHost/test/node/copilotToolDisplay.test|title=apply_patch tool display falls back to a generic message when the patch body is missing or unparseable|occurrence=1copilotToolDisplay.test|…read_ shell tools getInvocationMessage read_bash returns a non-empty message|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/agentHost/test/node/copilotToolDisplay.test|title=copilotToolDisplay — write_/read_ shell tools getInvocationMessage read_bash returns a non-empty message|occurrence=1read_ shell tools getInv…read_ shell tools getInvocationMessage read_powershell returns a non-empty message|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/agentHost/test/node/copilotToolDisplay.test|title=copilotToolDisplay — write_/read_ shell tools getInvocationMessage read_powershell returns a non-empty message|occurrence=1read_ shell tools getInv…read_ shell tools getInvocationMessage write_bash without command returns a non-empty fallback message|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/agentHost/test/node/copilotToolDisplay.test|title=copilotToolDisplay — write_/read_ shell tools getInvocationMessage write_bash without command returns a non-empty fallback message|occurrence=1read_ shell tools getInv…read_ shell tools getPastTenseMessage read_bash success returns a non-empty message|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/agentHost/test/node/copilotToolDisplay.test|title=copilotToolDisplay — write_/read_ shell tools getPastTenseMessage read_bash success returns a non-empty message|occurrence=1read_ shell tools getPas…read_ shell tools getPastTenseMessage write_bash without command returns a non-empty fallback message|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/agentHost/test/node/copilotToolDisplay.test|title=copilotToolDisplay — write_/read_ shell tools getPastTenseMessage write_bash without command returns a non-empty fallback message|occurrence=1read_ shell tools getPas… grep search tool display rg without a pattern falls back to a generic search message (not the raw tool name)|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/agentHost/test/node/copilotToolDisplay.test|title=rg / grep search tool display rg without a pattern falls back to a generic search message (not the raw tool name)|occurrence=1 grep search tool displa…copilotToolDisplay.test|title=sql tool display falls back to generic SQL wording when description is absent|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/agentHost/test/node/copilotToolDisplay.test|title=sql tool display falls back to generic SQL wording when description is absent|occurrence=1copilotToolDisplay.test|…copilotToolDisplay.test|title=web_fetch tool display falls back to generic URL wording when the URL is absent|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/agentHost/test/node/copilotToolDisplay.test|title=web_fetch tool display falls back to generic URL wording when the URL is absent|occurrence=1copilotToolDisplay.test|…claudeBuiltinCommands.test|title=claudeBuiltinCommands curated container excludes built-ins that collide with a discovered disk skill|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/agentHost/test/node/customizations/claudeBuiltinCommands.test|title=claudeBuiltinCommands curated container excludes built-ins that collide with a discovered disk skill|occurrence=1claudeBuiltinCommands.te…serverToolGroups.test|title=serverToolGroups display transport-prefixed names (Claude mcp__host__) match the bare tool|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/agentHost/test/node/serverToolGroups.test|title=serverToolGroups display transport-prefixed names (Claude mcp__host__) match the bare tool|occurrence=1serverToolGroups.test|ti…sshRemoteAgentHostService.test|title=SSHRemoteAgentHostMainService - _buildAuthAttempts KeyFile + unreadable key throws with the path in the message|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/agentHost/test/node/sshRemoteAgentHostService.test|title=SSHRemoteAgentHostMainService - _buildAuthAttempts KeyFile + unreadable key throws with the path in the message|occurrence=1sshRemoteAgentHostServic…environmentService.test|title=EnvironmentService parseExtensionHostPort when unbuilt|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/environment/test/node/environmentService.test|title=EnvironmentService parseExtensionHostPort when unbuilt|occurrence=1environmentService.test|…extensionNls.test|title=Localize Manifest replaces template strings - is best effort #164630|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/extensionManagement/test/common/extensionNls.test|title=Localize Manifest replaces template strings - is best effort #164630|occurrence=1extensionNls.test|title=…markerService.test|title=Marker Service out of order filter disposal works correctly|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/markers/test/common/markerService.test|title=Marker Service out of order filter disposal works correctly|occurrence=1markerService.test|title…undoRedoService.test|title=UndoRedoService multi resource elements|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/undoRedo/test/common/undoRedoService.test|title=UndoRedoService multi resource elements|occurrence=1undoRedoService.test|tit…chatVariableEntries.test|title=Chat variable entries summarizes explicit file and image entries|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/workbench/contrib/chat/test/common/attachments/chatVariableEntries.test|title=Chat variable entries summarizes explicit file and image entries|occurrence=1chatVariableEntries.test…chatExternalPathConfirmation.test|title=ChatExternalPathConfirmationContribution allow repo in session - cached git root|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/workbench/contrib/chat/test/common/tools/builtinTools/chatExternalPathConfirmation.test|title=ChatExternalPathConfirmationContribution allow repo in session - cached git root|occurrence=1chatExternalPathConfirma…taskConfiguration.test|title=Task configuration conversions ProblemMatcherConverter.from returns [] and an error for an unknown problem matcher|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/workbench/contrib/tasks/test/common/taskConfiguration.test|title=Task configuration conversions ProblemMatcherConverter.from returns [] and an error for an unknown problem matcher|occurrence=1taskConfiguration.test|t…taskConfiguration.test|title=Task configuration conversions TaskParser.from CustomTask incomplete config reports an appropriate error for missing command|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/workbench/contrib/tasks/test/common/taskConfiguration.test|title=Task configuration conversions TaskParser.from CustomTask incomplete config reports an appropriate error for missing command|occurrence=1taskConfiguration.test|t…taskConfiguration.test|title=Task configuration conversions TaskParser.from CustomTask incomplete config reports an appropriate error for missing name|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/workbench/contrib/tasks/test/common/taskConfiguration.test|title=Task configuration conversions TaskParser.from CustomTask incomplete config reports an appropriate error for missing name|occurrence=1taskConfiguration.test|t…updateUtils.test|title=UpdateUtils formatBytes formats bytes for values less than 1 KB|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/workbench/contrib/update/test/common/updateUtils.test|title=UpdateUtils formatBytes formats bytes for values less than 1 KB|occurrence=1updateUtils.test|title=U…Focused file · src/vs/nls.ts · 244 LOCvs/nls.ts

Graph controls are ready.

Interactive rendering requires JavaScript and WebGL. Use the related-file, concept, and source links on this page while the interactive map is unavailable.

1 > /*--------------------------------------------------------------------------------------------- map.ts ×97
2 > * Copyright (c) Microsoft Corporation. All rights reserved.
3 > * Licensed under the MIT License. See License.txt in the project root for license information.
4 > *--------------------------------------------------------------------------------------------*/
5 >
6 > export function getNLSMessages(): string[] {
7 return globalThis._VSCODE_NLS_MESSAGES;
8 }
10 > export function getNLSLanguage(): string | undefined {
11 > return globalThis._VSCODE_NLS_LANGUAGE;
12 > }
13 >
14 > declare const document: { location?: { hash?: string } } | undefined;
15 > const isPseudo = getNLSLanguage() === 'pseudo' || (typeof document !== 'undefined' && document.location && typeof document.location.hash === 'string' && document.location.hash.indexOf('pseudo=true') >= 0);
16 >
17 > export interface ILocalizeInfo {
18 > key: string;
19 > comment: string[];
20 > }
21 >
22 > export interface ILocalizedString {
23 > original: string;
24 > value: string;
25 > }
26 >
27 > function _format(message: string, args: (string | number | boolean | undefined | null)[]): string { nls.ts ×6
28 > let result: string;
29 >
30 > if (args.length === 0) {
31 > result = message; nls.ts ×1
32 > } else { nls.ts ×6
33 > result = message.replace(/\{(\d+)\}/g, (match, rest) => { nls.ts ×3
34 > const index = rest[0];
35 > const arg = args[index];
36 > let result = match;
37 > if (typeof arg === 'string') {
38 > result = arg; nls.ts ×1
39 > } else if (typeof arg === 'number' || typeof arg === 'boolean' || arg === void 0 || arg === null) { nls.ts ×3
40 > result = String(arg); nls.ts ×1
41 > }
42 > return result; nls.ts ×3
43 > });
44 > }
45 > nls.ts ×6
46 > if (isPseudo) {
47 // FF3B and FF3D is the Unicode zenkaku representation for [ and ]
48 result = '\uFF3B' + result.replace(/[aouei]/g, '$&$&') + '\uFF3D';
49 }
50 > nls.ts ×6
51 > return result;
52 > }
54 > /**
55 > * Marks a string to be localized. Returns the localized string.
56 > *
57 > * @param info The {@linkcode ILocalizeInfo} which describes the id and comments associated with the localized string.
58 > * @param message The string to localize
59 > * @param args The arguments to the string
60 > *
61 > * @note `message` can contain `{n}` notation where it is replaced by the nth value in `...args`
62 > * @example `localize({ key: 'sayHello', comment: ['Welcomes user'] }, 'hello {0}', name)`
63 > *
64 > * @returns string The localized string.
65 > */
66 > export function localize(info: ILocalizeInfo, message: string, ...args: (string | number | boolean | undefined | null)[]): string;
67 >
68 > /**
69 > * Marks a string to be localized. Returns the localized string.
70 > *
71 > * @param key The key to use for localizing the string
72 > * @param message The string to localize
73 > * @param args The arguments to the string
74 > *
75 > * @note `message` can contain `{n}` notation where it is replaced by the nth value in `...args`
76 > * @example For example, `localize('sayHello', 'hello {0}', name)`
77 > *
78 > * @returns string The localized string.
79 > */
80 > export function localize(key: string, message: string, ...args: (string | number | boolean | undefined | null)[]): string;
81 >
82 > /**
83 > * @skipMangle
84 > */
85 > export function localize(data: ILocalizeInfo | string /* | number when built */, message: string /* | null when built */, ...args: (string | number | boolean | undefined | null)[]): string {
86 > if (typeof data === 'number') { nls.ts ×6
87 return _format(lookupMessage(data, message), args);
88 }
89 > return _format(message, args); nls.ts ×6
90 > }
92 > /**
93 > * Only used when built: Looks up the message in the global NLS table.
94 > * This table is being made available as a global through bootstrapping
95 > * depending on the target context.
96 > */
97 function lookupMessage(index: number, fallback: string | null): string {
98 const message = getNLSMessages()?.[index];
99 if (typeof message !== 'string') {
100 if (typeof fallback === 'string') {
101 return fallback;
102 }
103 throw new Error(`!!! NLS MISSING: ${index} !!!`);
104 }
105 return message;
106 }
107 > map.ts ×97
108 > /**
109 > * Marks a string to be localized. Returns an {@linkcode ILocalizedString}
110 > * which contains the localized string and the original string.
111 > *
112 > * @param info The {@linkcode ILocalizeInfo} which describes the id and comments associated with the localized string.
113 > * @param message The string to localize
114 > * @param args The arguments to the string
115 > *
116 > * @note `message` can contain `{n}` notation where it is replaced by the nth value in `...args`
117 > * @example `localize2({ key: 'sayHello', comment: ['Welcomes user'] }, 'hello {0}', name)`
118 > *
119 > * @returns ILocalizedString which contains the localized string and the original string.
120 > */
121 > export function localize2(info: ILocalizeInfo, message: string, ...args: (string | number | boolean | undefined | null)[]): ILocalizedString;
122 >
123 > /**
124 > * Marks a string to be localized. Returns an {@linkcode ILocalizedString}
125 > * which contains the localized string and the original string.
126 > *
127 > * @param key The key to use for localizing the string
128 > * @param message The string to localize
129 > * @param args The arguments to the string
130 > *
131 > * @note `message` can contain `{n}` notation where it is replaced by the nth value in `...args`
132 > * @example `localize('sayHello', 'hello {0}', name)`
133 > *
134 > * @returns ILocalizedString which contains the localized string and the original string.
135 > */
136 > export function localize2(key: string, message: string, ...args: (string | number | boolean | undefined | null)[]): ILocalizedString;
137 >
138 > /**
139 > * @skipMangle
140 > */
141 > export function localize2(data: ILocalizeInfo | string /* | number when built */, originalMessage: string, ...args: (string | number | boolean | undefined | null)[]): ILocalizedString {
142 > let message: string; nls.ts ×2
143 > if (typeof data === 'number') {
144 message = lookupMessage(data, originalMessage);
145 > } else { nls.ts ×2
146 > message = originalMessage;
147 > }
148 >
149 > const value = _format(message, args);
150 >
151 > return {
152 > value,
153 > original: originalMessage === message ? value : _format(originalMessage, args)
154 > };
155 > }
156 > map.ts ×97
157 > export interface INLSLanguagePackConfiguration {
158 >
159 > /**
160 > * The path to the translations config file that contains pointers to
161 > * all message bundles for `main` and extensions.
162 > */
163 > readonly translationsConfigFile: string;
164 >
165 > /**
166 > * The path to the file containing the translations for this language
167 > * pack as flat string array.
168 > */
169 > readonly messagesFile: string;
170 >
171 > /**
172 > * The path to the file that can be used to signal a corrupt language
173 > * pack, for example when reading the `messagesFile` fails. This will
174 > * instruct the application to re-create the cache on next startup.
175 > */
176 > readonly corruptMarkerFile: string;
177 > }
178 >
179 > export interface INLSConfiguration {
180 >
181 > /**
182 > * Locale as defined in `argv.json` or `app.getLocale()`.
183 > */
184 > readonly userLocale: string;
185 >
186 > /**
187 > * Locale as defined by the OS (e.g. `app.getPreferredSystemLanguages()`).
188 > */
189 > readonly osLocale: string;
190 >
191 > /**
192 > * The actual language of the UI that ends up being used considering `userLocale`
193 > * and `osLocale`.
194 > */
195 > readonly resolvedLanguage: string;
196 >
197 > /**
198 > * Defined if a language pack is used that is not the
199 > * default english language pack. This requires a language
200 > * pack to be installed as extension.
201 > */
202 > readonly languagePack?: INLSLanguagePackConfiguration;
203 >
204 > /**
205 > * The path to the file containing the default english messages
206 > * as flat string array. The file is only present in built
207 > * versions of the application.
208 > */
209 > readonly defaultMessagesFile: string;
210 >
211 > /**
212 > * Below properties are deprecated and only there to continue support
213 > * for `vscode-nls` module that depends on them.
214 > * Refs https://github.com/microsoft/vscode-nls/blob/main/src/node/main.ts#L36-L46
215 > */
216 > /** @deprecated */
217 > readonly locale: string;
218 > /** @deprecated */
219 > readonly availableLanguages: Record<string, string>;
220 > /** @deprecated */
221 > readonly _languagePackSupport?: boolean;
222 > /** @deprecated */
223 > readonly _languagePackId?: string;
224 > /** @deprecated */
225 > readonly _translationsConfigFile?: string;
226 > /** @deprecated */
227 > readonly _cacheRoot?: string;
228 > /** @deprecated */
229 > readonly _resolvedLanguagePackCoreLocation?: string;
230 > /** @deprecated */
231 > readonly _corruptedFile?: string;
232 > }
233 >
234 > export interface ILanguagePack {
235 > readonly hash: string;
236 > readonly label: string | undefined;
237 > readonly extensions: {
238 > readonly extensionIdentifier: { readonly id: string; readonly uuid?: string };
239 > readonly version: string;
240 > }[];
241 > readonly translations: Record<string, string | undefined>;
242 > }
243 >
244 > export type ILanguagePacks = Record<string, ILanguagePack | undefined>;