Skip to content

Commit

Permalink
Need to spread the array for format (#161852)
Browse files Browse the repository at this point in the history
  • Loading branch information
TylerLeonhardt committed Sep 26, 2022
1 parent 06bd7ae commit 9883eb4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/vs/workbench/api/common/extHostLocalizationService.ts
Original file line number Diff line number Diff line change
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

0 comments on commit 9883eb4

Please sign in to comment.