Closed javiereguiluz closed 8 years ago
Seems legit to me. In a growing app, you might want to use multiple domains anyway. :+1:
As usual, let's see how does Sonata solve this problem. In this article we can see that you can define the translation domain in two ways:
Entity
config) via the $translationDomain
property. Example:class PageAdmin extends Admin
{
protected $translationDomain = 'SonataPageBundle'; // default is 'messages'
}
translation_domain
option. Example:->add('publishable', 'checkbox', array(), array(
'translation_domain' => 'MyTranslationDomain',
))
A per entity translation_domain
is good to me too (in complement of per-field of course), but there is one flaw with that: You might want to configure the translation_domain
for the entity label (in the left-menu for instance). Should a translation_domain
option at the entity level configure both entity label and all properties ?
BTW, those new issues are great, nice work @javiereguiluz :)
@javiereguiluz I know you're very busy but some advice on this?
Hi everyone, @javiereguiluz Is there any update about this feature ? How can we help ? Thanks
Closing it as fixed by #1347. This will be available in the next stable version (to be released soon).
In #716 @reypm discussed about this use case: he wants to reuse the translations of FOSUserBundle for the property labels. Should we add this feature or should we consider an edge case and ignore it?
The changes that it would imply:
type_options: { translation_domain: 'FOSUserBundle' }
butlist
andshow
views cannot use that trick.translation_domain
of each propertylist
andshow
views should updated their Twig template code to take into account thetranslation_domain
of each property