From 319fbc6577e9e545b30bef5086f57c69886abfd6 Mon Sep 17 00:00:00 2001 From: mateuswetah Date: Mon, 29 Jul 2024 15:35:56 -0300 Subject: [PATCH] Makes ' is required' metadata message translatable. --- src/classes/entities/class-tainacan-item-metadata-entity.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/classes/entities/class-tainacan-item-metadata-entity.php b/src/classes/entities/class-tainacan-item-metadata-entity.php index c0129295e..1aee3abf8 100644 --- a/src/classes/entities/class-tainacan-item-metadata-entity.php +++ b/src/classes/entities/class-tainacan-item-metadata-entity.php @@ -476,7 +476,8 @@ class Item_Metadata_Entity extends Entity { if ($this->is_required()) { $validation_statuses = ['publish', 'future', 'private']; 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; } else { return $this->set_as_valid(); @@ -532,7 +533,7 @@ class Item_Metadata_Entity extends Entity { ], $item->get_collection()); if ($test->have_posts()) { - // translators: %s = metadatum name. ex: Register ID is a collection key and there is another item with the same value + // translators: %s = metadatum name. ex: Register ID is a collection key and there is another item with the same value $this->add_error( 'key_exists', sprintf( __('%s is a collection key and there is another item with the same value', 'tainacan'), $metadatum->get_name() ) ); return false; }