X-Git-Url: http://source.bookstackapp.com/bookstack/blobdiff_plain/d22413b9317b40110fa2fd41134d1831dd760d0b..refs/pull/5681/head:/resources/js/services/translations.ts diff --git a/resources/js/services/translations.ts b/resources/js/services/translations.ts index b37dbdfb0..f548a51d1 100644 --- a/resources/js/services/translations.ts +++ b/resources/js/services/translations.ts @@ -10,6 +10,7 @@ export class Translator { * to use. Similar format at Laravel's 'trans_choice' helper. */ choice(translation: string, count: number, replacements: Record = {}): string { + replacements = Object.assign({}, {count: String(count)}, replacements); const splitText = translation.split('|'); const exactCountRegex = /^{([0-9]+)}/; const rangeRegex = /^\[([0-9]+),([0-9*]+)]/;