EasyCorp / EasyAdminBundle

EasyAdmin is a fast, beautiful and modern admin generator for Symfony applications.
MIT License
4.09k stars 1.03k forks source link

[RFC] Add support for defining the translation_domain of property labels #720

Closed javiereguiluz closed 8 years ago

javiereguiluz commented 8 years ago

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:

ogizanagi commented 8 years ago

Seems legit to me. In a growing app, you might want to use multiple domains anyway. :+1:

javiereguiluz commented 8 years ago

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:

class PageAdmin extends Admin
{
    protected $translationDomain = 'SonataPageBundle'; // default is 'messages'
}
->add('publishable', 'checkbox', array(), array(
    'translation_domain' => 'MyTranslationDomain',
))
ogizanagi commented 8 years ago

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 :)

reypm commented 8 years ago

@javiereguiluz I know you're very busy but some advice on this?

nassuf commented 8 years ago

Hi everyone, @javiereguiluz Is there any update about this feature ? How can we help ? Thanks

javiereguiluz commented 8 years ago

Closing it as fixed by #1347. This will be available in the next stable version (to be released soon).