Fix #4558 - locale "selectedItemsLabel" is broken on MultiSelect

pull/4588/head
Chingiz Mammadov 2023-10-11 01:48:17 +04:00
parent b85876be95
commit 456d4e338f
No known key found for this signature in database
GPG Key ID: ABCB4517F50A9077
2 changed files with 5 additions and 5 deletions

1
.gitignore vendored
View File

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

View File

@ -770,12 +770,11 @@ export default {
}, },
getSelectedItemsLabel() { getSelectedItemsLabel() {
let pattern = /{(.*?)}/; let pattern = /{(.*?)}/;
const selectedItemsLabel = this.$primevue.config.locale.selectedItemsLabel || this.selectedItemsLabel
if (pattern.test(this.selectedItemsLabel)) { if (pattern.test(selectedItemsLabel)) {
return this.selectedItemsLabel.replace(this.selectedItemsLabel.match(pattern)[0], this.modelValue.length + ''); return selectedItemsLabel.replace(selectedItemsLabel.match(pattern)[0], this.modelValue.length + '');
} }
return selectedItemsLabel;
return this.selectedItemsLabel;
}, },
onToggleAll(event) { onToggleAll(event) {
if (this.selectAll !== null) { if (this.selectAll !== null) {