From eaa529528cafcfb291009f9f99d296c81e792899 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 24 May 2022 16:29:01 +0200 Subject: Support ICU in TS components --- .../shared/shared-forms/select/select-checkbox-all.component.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'client/src/app/shared/shared-forms') diff --git a/client/src/app/shared/shared-forms/select/select-checkbox-all.component.ts b/client/src/app/shared/shared-forms/select/select-checkbox-all.component.ts index ebf7b77a6..2c3226f68 100644 --- a/client/src/app/shared/shared-forms/select/select-checkbox-all.component.ts +++ b/client/src/app/shared/shared-forms/select/select-checkbox-all.component.ts @@ -1,6 +1,7 @@ import { Component, forwardRef, Input } from '@angular/core' import { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms' import { Notifier } from '@app/core' +import { prepareIcu } from '@app/helpers' import { SelectOptionsItem } from '../../../../types/select-options-item.model' import { ItemSelectCheckboxValue } from './select-checkbox.component' @@ -78,7 +79,12 @@ export class SelectCheckboxAllComponent implements ControlValueAccessor { if (!outputItems) return true if (outputItems.length >= this.maxItems) { - this.notifier.error($localize`You can't select more than ${this.maxItems} items`) + this.notifier.error( + prepareIcu($localize`You can't select more than {maxItems, plural, =1 {1 item} other {{maxItems} items}}`)( + { maxItems: this.maxItems }, + $localize`You can't select more than ${this.maxItems} items` + ) + ) return false } -- cgit v1.2.3