From 456d4e338f8ef7c9c96db5b8f461a67f56524ddf Mon Sep 17 00:00:00 2001 From: Chingiz Mammadov Date: Wed, 11 Oct 2023 01:48:17 +0400 Subject: [PATCH] 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 97448750c..6b1acf8ed 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 fc017af66..8355d233e 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) {