Use sprintf for custom field name

[MAILPOET-5036]

Co-authored-by: David Remer <webmaster@websupporter.net>
This commit is contained in:
Jan Jakeš
2023-05-10 16:08:01 +02:00
committed by Aschepikov
parent ddfdbb23dc
commit 1fb2580a92

View File

@@ -151,7 +151,11 @@ class SubscriberCustomFieldsFactory {
private function createField(CustomFieldEntity $customField, string $type, callable $factory, array $args = []): Field { private function createField(CustomFieldEntity $customField, string $type, callable $factory, array $args = []): Field {
$key = 'mailpoet:subscriber:custom-field:' . $customField->getName(); $key = 'mailpoet:subscriber:custom-field:' . $customField->getName();
$name = __('Custom field', 'mailpoet') . ': ' . ($customField->getParams()['label'] ?? $customField->getName()); $name = sprintf(
// translators: %s is the name of the custom field
__('Custom field: %s', 'mailpoet'),
$customField->getParams()['label'] ?? $customField->getName()
);
return new Field($key, $type, $name, $factory, $args); return new Field($key, $type, $name, $factory, $args);
} }