diff --git a/src/bundle/Resources/translations/validators.en.xliff b/src/bundle/Resources/translations/validators.en.xliff index 5bd0ae7b79..8ad4a705c0 100644 --- a/src/bundle/Resources/translations/validators.en.xliff +++ b/src/bundle/Resources/translations/validators.en.xliff @@ -77,8 +77,8 @@ key: ezplatform.trash.location_has_no_children - The Language code {{ value }} contains illegal characters. Language code should start with a letter, digit or underscore and only contain letters, digits, numbers, underscores ("_"), hyphens ("-") and colons (":")."). - The Language code {{ value }} contains illegal characters. Language code should start with a letter, digit or underscore and only contain letters, digits, numbers, underscores ("_"), hyphens ("-") and colons (":")."). + The Language code {{ value }} contains illegal characters. Language code should start with a letter, digit or underscore and only contain letters, digits, numbers, underscores, hyphens and colons. + The Language code {{ value }} contains illegal characters. Language code should start with a letter, digit or underscore and only contain letters, digits, numbers, underscores, hyphens and colons. key: ibexa.language.language_code.format diff --git a/src/lib/Form/Data/Language/LanguageCreateData.php b/src/lib/Form/Data/Language/LanguageCreateData.php index 1e7cf0a311..0ba6bb049d 100644 --- a/src/lib/Form/Data/Language/LanguageCreateData.php +++ b/src/lib/Form/Data/Language/LanguageCreateData.php @@ -7,9 +7,11 @@ namespace Ibexa\AdminUi\Form\Data\Language; +use JMS\TranslationBundle\Model\Message; +use JMS\TranslationBundle\Translation\TranslationContainerInterface; use Symfony\Component\Validator\Constraints as Assert; -class LanguageCreateData +class LanguageCreateData implements TranslationContainerInterface { /** * @var string @@ -92,6 +94,16 @@ public function setEnabled(bool $enabled): self return $this; } + + public static function getTranslationMessages(): array + { + return [ + Message::create('ibexa.language.language_code.format', 'validators') + ->setDesc( + 'The Language code {{ value }} contains illegal characters. Language code should start with a letter, digit or underscore and only contain letters, digits, numbers, underscores, hyphens and colons.' + ), + ]; + } } class_alias(LanguageCreateData::class, 'EzSystems\EzPlatformAdminUi\Form\Data\Language\LanguageCreateData');