Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 2 commits into from
Oct 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ coverage
dist
.DS_Store
.vscode
.idea
.eslintcache
9 changes: 4 additions & 5 deletions components/lib/multiselect/MultiSelect.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
Loading