Makes ' is required' metadata message translatable.

This commit is contained in:
mateuswetah 2024-07-29 15:35:56 -03:00
parent cc42170623
commit 319fbc6577
1 changed files with 3 additions and 2 deletions

View File

@ -476,7 +476,8 @@ class Item_Metadata_Entity extends Entity {
if ($this->is_required()) { if ($this->is_required()) {
$validation_statuses = ['publish', 'future', 'private']; $validation_statuses = ['publish', 'future', 'private'];
if (in_array($item->get_status(), apply_filters( 'tainacan-status-require-validation', $validation_statuses) )) { if (in_array($item->get_status(), apply_filters( 'tainacan-status-require-validation', $validation_statuses) )) {
$this->add_error('required', $metadatum->get_name() . ' is required'); // translators: %s = metadatum name. ex: Title is required
$this->add_error( 'required', sprintf( __('%s is required', 'tainacan'), $metadatum->get_name() ) );
return false; return false;
} else { } else {
return $this->set_as_valid(); return $this->set_as_valid();