Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Need to spread the array for format #161852

Merged
merged 1 commit into from Sep 26, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/vs/workbench/api/common/extHostLocalizationService.ts
Expand Up @@ -35,7 +35,7 @@ export class ExtHostLocalizationService implements ExtHostLocalizationShape {
getMessage(extensionId: string, details: IStringDetails): string {
const { message, args, comment } = details;
if (this.isDefaultLanguage) {
return format(message, args);
return format(message, ...(args ?? []));
}

let key = message;
Expand All @@ -46,7 +46,7 @@ export class ExtHostLocalizationService implements ExtHostLocalizationShape {
if (!str) {
this.logService.warn(`Using default string since no string found in i18n bundle that has the key: ${key}`);
}
return format(str ?? key, args);
return format(str ?? key, ...(args ?? []));
}

getBundle(extensionId: string): { [key: string]: string } {
Expand Down