]> BookStack Code Mirror - bookstack/blobdiff - resources/js/services/translations.ts
ZIP Imports: Added API examples, finished testing
[bookstack] / resources / js / services / translations.ts
index b37dbdfb07438501a26feca177b1f5d78b6ba3e9..f548a51d1d17d4094d6f2e51fb204989e4d5111d 100644 (file)
@@ -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, string> = {}): string {
+        replacements = Object.assign({}, {count: String(count)}, replacements);
         const splitText = translation.split('|');
         const exactCountRegex = /^{([0-9]+)}/;
         const rangeRegex = /^\[([0-9]+),([0-9*]+)]/;