From 456d4e338f8ef7c9c96db5b8f461a67f56524ddf Mon Sep 17 00:00:00 2001 From: Chingiz Mammadov Date: Wed, 11 Oct 2023 01:48:17 +0400 Subject: [PATCH 1/2] Fix #4558 - locale "selectedItemsLabel" is broken on MultiSelect --- .gitignore | 1 + components/lib/multiselect/MultiSelect.vue | 9 ++++----- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index 97448750c0..6b1acf8ed0 100644 --- a/.gitignore +++ b/.gitignore @@ -9,4 +9,5 @@ coverage dist .DS_Store .vscode +.idea .eslintcache diff --git a/components/lib/multiselect/MultiSelect.vue b/components/lib/multiselect/MultiSelect.vue index fc017af66e..8355d233ee 100755 --- a/components/lib/multiselect/MultiSelect.vue +++ b/components/lib/multiselect/MultiSelect.vue @@ -770,12 +770,11 @@ export default { }, getSelectedItemsLabel() { let pattern = /{(.*?)}/; - - if (pattern.test(this.selectedItemsLabel)) { - return this.selectedItemsLabel.replace(this.selectedItemsLabel.match(pattern)[0], this.modelValue.length + ''); + const selectedItemsLabel = this.$primevue.config.locale.selectedItemsLabel || this.selectedItemsLabel + if (pattern.test(selectedItemsLabel)) { + return selectedItemsLabel.replace(selectedItemsLabel.match(pattern)[0], this.modelValue.length + ''); } - - return this.selectedItemsLabel; + return selectedItemsLabel; }, onToggleAll(event) { if (this.selectAll !== null) { From 8c2b417ffcdce2d6e6e9931327d493578a520904 Mon Sep 17 00:00:00 2001 From: Chingiz Mammadov Date: Wed, 11 Oct 2023 02:16:10 +0400 Subject: [PATCH 2/2] Fix #4558 - locale "selectedItemsLabel" is broken on MultiSelect --- components/lib/multiselect/MultiSelect.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/lib/multiselect/MultiSelect.vue b/components/lib/multiselect/MultiSelect.vue index 8355d233ee..949ac87675 100755 --- a/components/lib/multiselect/MultiSelect.vue +++ b/components/lib/multiselect/MultiSelect.vue @@ -770,7 +770,7 @@ export default { }, getSelectedItemsLabel() { let pattern = /{(.*?)}/; - const selectedItemsLabel = this.$primevue.config.locale.selectedItemsLabel || this.selectedItemsLabel + const selectedItemsLabel = this.$primevue.config.locale.selectionMessage || this.selectedItemsLabel if (pattern.test(selectedItemsLabel)) { return selectedItemsLabel.replace(selectedItemsLabel.match(pattern)[0], this.modelValue.length + ''); }