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:
882
882
Also it can denormalize ``uuid `` or ``ulid `` strings to :class: `Symfony\\ Component\\ Uid\\ Uuid `
883
883
or :class: `Symfony\\ Component\\ Uid\\ Ulid `. The format does not matter.
884
884
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
+
885
899
.. note ::
886
900
887
901
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:
75
75
* :class: `Symfony\\ Component\\ Serializer\\ Normalizer\\ ConstraintViolationListNormalizer `
76
76
* :class: `Symfony\\ Component\\ Serializer\\ Normalizer\\ ProblemNormalizer `
77
77
* :class: `Symfony\\ Component\\ Serializer\\ Normalizer\\ BackedEnumNormalizer `
78
+ * :class: `Symfony\\ Component\\ Serializer\\ Normalizer\\ TranslatableNormalizer `
78
79
79
80
Other :ref: `built-in normalizers <component-serializer-normalizers >` and
80
81
custom normalizers and/or encoders can also be loaded by tagging them as
You can’t perform that action at this time.
0 commit comments