File tree Expand file tree Collapse file tree 2 files changed +15
-0
lines changed Expand file tree Collapse file tree 2 files changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -882,6 +882,20 @@ The Serializer component provides several built-in normalizers:
882882 Also it can denormalize ``uuid `` or ``ulid `` strings to :class: `Symfony\\ Component\\ Uid\\ Uuid `
883883 or :class: `Symfony\\ Component\\ Uid\\ Ulid `. The format does not matter.
884884
885+ :class: `Symfony\\ Component\\ Serializer\\ Normalizer\\ TranslatableNormalizer `
886+ This normalizer converts objects that implement
887+ :class: `Symfony\\ Contracts\\ Translation\\ TranslatableInterface ` into
888+ translated strings, using the
889+ :method: `Symfony\\ Contracts\\ Translation\\ TranslatableInterface::trans `
890+ method. You can define the locale to use to translate the object by
891+ setting the ``TranslatableNormalizer::NORMALIZATION_LOCALE_KEY `` serializer
892+ context option.
893+
894+ .. versionadded :: 6.4
895+
896+ The :class: `Symfony\\ Component\\ Serializer\\ Normalizer\\ TranslatableNormalizer `
897+ was introduced in Symfony 6.4.
898+
885899.. note ::
886900
887901 You can also create your own Normalizer to use another structure. Read more at
Original file line number Diff line number Diff line change @@ -75,6 +75,7 @@ As well as the following normalizers:
7575* :class: `Symfony\\ Component\\ Serializer\\ Normalizer\\ ConstraintViolationListNormalizer `
7676* :class: `Symfony\\ Component\\ Serializer\\ Normalizer\\ ProblemNormalizer `
7777* :class: `Symfony\\ Component\\ Serializer\\ Normalizer\\ BackedEnumNormalizer `
78+ * :class: `Symfony\\ Component\\ Serializer\\ Normalizer\\ TranslatableNormalizer `
7879
7980Other :ref: `built-in normalizers <component-serializer-normalizers >` and
8081custom normalizers and/or encoders can also be loaded by tagging them as
You can’t perform that action at this time.
0 commit comments