Makes ' is required' metadata message translatable.
This commit is contained in:
parent
cc42170623
commit
319fbc6577
|
@ -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();
|
||||||
|
|
Loading…
Reference in New Issue