From 2cbe7f2762a9722f526ca5cbeae45cd81926c5b2 Mon Sep 17 00:00:00 2001 From: Eric Amodio Date: Sun, 31 Jan 2021 01:00:52 -0500 Subject: [PATCH] Removes suffix from pluralize --- src/commands/git/branch.ts | 2 +- src/system/string.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/commands/git/branch.ts b/src/commands/git/branch.ts index 153fb61..66cc864 100644 --- a/src/commands/git/branch.ts +++ b/src/commands/git/branch.ts @@ -349,7 +349,7 @@ export class BranchGitCommand extends QuickCommand { context.title = getTitle( Strings.pluralize('Branch', state.references.length, { number: '', - suffix: 'es', + plural: 'Branches', }).trim(), state.subcommand, ); diff --git a/src/system/string.ts b/src/system/string.ts index 14f32ca..228681d 100644 --- a/src/system/string.ts +++ b/src/system/string.ts @@ -349,13 +349,13 @@ export function padRightOrTruncate(s: string, max: number, padding?: string, wid export function pluralize( s: string, count: number, - options?: { infix?: string; number?: string; plural?: string; suffix?: string; zero?: string }, + options?: { infix?: string; number?: string; plural?: string; zero?: string }, ) { if (options == null) return `${count} ${s}${count === 1 ? emptyStr : 's'}`; return `${ count === 0 ? (options.zero != null ? options.zero : count) : options.number != null ? options.number : count - }${options.infix ?? ' '}${count === 1 ? s : options.plural ?? `${s}${options.suffix ?? 's'}`}`; + }${options.infix ?? ' '}${count === 1 ? s : options.plural ?? `${s}s`}`; } // Removes \ / : * ? " < > | and C0 and C1 control codes