From e4c32820a4f1bdeac14da51a32e9d09e96cb2c78 Mon Sep 17 00:00:00 2001 From: Mikolaj Adamczyk Date: Tue, 5 Sep 2023 11:01:41 +0200 Subject: [PATCH] IBX-6415: Renamed domain names (#127) --- ...{fieldtypes.en.xliff => ibexa_fieldtypes.en.xliff} | 2 +- .../Resources/views/RichText/content_fields.html.twig | 2 +- src/lib/FieldType/RichText/Type.php | 11 ++++++++++- 3 files changed, 12 insertions(+), 3 deletions(-) rename src/bundle/Resources/translations/{fieldtypes.en.xliff => ibexa_fieldtypes.en.xliff} (94%) diff --git a/src/bundle/Resources/translations/fieldtypes.en.xliff b/src/bundle/Resources/translations/ibexa_fieldtypes.en.xliff similarity index 94% rename from src/bundle/Resources/translations/fieldtypes.en.xliff rename to src/bundle/Resources/translations/ibexa_fieldtypes.en.xliff index 1d2a83f3..d00e9b52 100644 --- a/src/bundle/Resources/translations/fieldtypes.en.xliff +++ b/src/bundle/Resources/translations/ibexa_fieldtypes.en.xliff @@ -8,7 +8,7 @@ Rich text - Rich text + Rich text key: ezrichtext.name diff --git a/src/bundle/Resources/views/RichText/content_fields.html.twig b/src/bundle/Resources/views/RichText/content_fields.html.twig index 5a339448..09e214d3 100644 --- a/src/bundle/Resources/views/RichText/content_fields.html.twig +++ b/src/bundle/Resources/views/RichText/content_fields.html.twig @@ -1,4 +1,4 @@ -{% trans_default_domain "content_fields" %} +{% trans_default_domain 'ibexa_content_fields' %} {% extends "@IbexaCore/content_fields.html.twig" %} diff --git a/src/lib/FieldType/RichText/Type.php b/src/lib/FieldType/RichText/Type.php index 2203ad3e..38b3afba 100644 --- a/src/lib/FieldType/RichText/Type.php +++ b/src/lib/FieldType/RichText/Type.php @@ -18,12 +18,14 @@ use Ibexa\Core\FieldType\FieldType; use Ibexa\Core\FieldType\ValidationError; use Ibexa\Core\FieldType\Value as BaseValue; +use JMS\TranslationBundle\Model\Message; +use JMS\TranslationBundle\Translation\TranslationContainerInterface; use RuntimeException; /** * RichText field type. */ -class Type extends FieldType +class Type extends FieldType implements TranslationContainerInterface { /** * @var \Ibexa\Contracts\FieldTypeRichText\RichText\InputHandlerInterface @@ -287,6 +289,13 @@ public function getRelations(SPIValue $value) return $relations; } + + public static function getTranslationMessages(): array + { + return [ + (new Message('ezrichtext.name', 'ibexa_fieldtypes'))->setDesc('Rich text'), + ]; + } } class_alias(Type::class, 'EzSystems\EzPlatformRichText\eZ\FieldType\RichText\Type');