You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Create a Contentful Space with 2 locales: English (default) and Italian;
Create an Entry Model "Blog Post" with a Body field of type Rich Text;
Create a "Blog Post" Entry with an Image in the Body field, the same image for the English and Italian Body fields;
The Image Asset has both title and description filled in both languages;
Try to render the Blog Post Entry in the not default language (Italian)
Expected Result
The title of the image present in the Body of the Blog Post should be in Italian
Actual Result
The title of the image present in the Body of the Blog Post is in English
Considerations
The issue is in the use of the \Contentful\Core\Api\LinkResolverInterface Interface. The Mappers should pass also the locale code in the second argument $parameters.
The Mappers that use this interface are:
This commit adds correct localization to richtext parsing. Previously,
the parser wasn't given a locale. This lead to bugs when the parser
attempted to resolve embedded entries or assets which were localized.
Note that this changes the ParserInterface and the NodeMapperInterface,
which means that this is a backwards-incompatible change and might need
adjustments for custom types.
See issue #65
Steps to reproduce
Expected Result
The title of the image present in the Body of the Blog Post should be in Italian
Actual Result
The title of the image present in the Body of the Blog Post is in English
Considerations
The issue is in the use of the
\Contentful\Core\Api\LinkResolverInterface
Interface. The Mappers should pass also the locale code in the second argument$parameters
.The Mappers that use this interface are:
\Contentful\RichText\NodeMapper\AssetHyperlink
\Contentful\RichText\NodeMapper\EmbeddedAssetBlock
\Contentful\RichText\NodeMapper\EmbeddedAssetInline
\Contentful\RichText\NodeMapper\Reference\EntryReference
The text was updated successfully, but these errors were encountered: