Merge pull request #4588 from chz/fix/4558

Fix #4558 - locale "selectedItemsLabel" is broken on MultiSelect
pull/4649/head
Tuğçe Küçükoğlu 2023-10-17 10:30:53 +03:00 committed by GitHub
commit dfb6c1081a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 5 deletions

1
.gitignore vendored
View File

@ -9,4 +9,5 @@ coverage
dist
.DS_Store
.vscode
.idea
.eslintcache

View File

@ -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.selectionMessage || 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) {