FIX: Fix broken translation in tags input field objects setting editor (#26340)

Why this change?

When a property of `type: tags` is required, we should be displaying the
"at least 1 tag is required" validation error message when there are no
tags selected in the `TagChooser` compoment. However, we were passing
`this.min` as the `count` attribute when generating the translation
string which is incorrect as `this.min` is not always set.
This commit is contained in:
Alan Guo Xiang Tan
2024-03-25 16:06:32 +08:00
committed by GitHub
parent 83ca1fd134
commit 8a6e43a3d4
3 changed files with 38 additions and 13 deletions

View File

@@ -36,8 +36,8 @@ export default class SchemaThemeSettingTypeTags extends Component {
(this.min && this.value.length < this.min) ||
(this.required && (!this.value || this.value.length === 0))
) {
return I18n.t("admin.customize.theme.schema.fields.tags.at_least_tag", {
count: this.min,
return I18n.t("admin.customize.theme.schema.fields.tags.at_least", {
count: this.min || 1,
});
}
}