Skip to content

fix translatable resource not getting its translation mapped with AsResource#1132

Open
esserj wants to merge 1 commit intoSylius:1.13from
Inventis:bugfix/translatable-resources-with-as-resource
Open

fix translatable resource not getting its translation mapped with AsResource#1132
esserj wants to merge 1 commit intoSylius:1.13from
Inventis:bugfix/translatable-resources-with-as-resource

Conversation

@esserj
Copy link
Copy Markdown
Contributor

@esserj esserj commented Jan 13, 2026

AsResource does not have translations configuration
and there seems to be no way to currently get it mapped properly when using attributes?
This ensures that when you AsResource tag your translation resource as <alias>_translation,
the mapping occurs, even without the resource metadata translation parameter.
which seemed to be an artificial limitation also not implemented in the mapTranslation

Q A
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Related tickets fixes #1018
License MIT

…esource

while the translation gets a mapping to the resource
fxes Sylius#1018

if (!$resourceMetadata->hasParameter('translation')) {
return;
}
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seems to be an artificial limitation?

}

/** @var MetadataInterface $translationResourceMetadata */
$translationResourceMetadata = $this->resourceMetadataRegistry->get($resourceMetadata->getAlias() . '_translation');
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we could also try catch here, but it seems to make sense that when you mark your entity translatable, you'd want an error that it cannot find your translation resource

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant