简体   繁体   中英

How to configure default values in SonataMediaBundle?

I installed SonataMediaBundle With SonataAdminBundle, and everything works fine. but labels of forms and filters looks bad. Something like : filter.label_name.

How can i set the label to "name" ?

I think that this is done to make easy integration of SonataPageBundle, but i don't use it.

在此处输入图片说明

The labels are generated using translations, so the fact that they aren't being handled suggests that you haven't set your locale.

For Symfony 2.0.x

# in app/config.yml

framework:
    session:
        default_locale: %locale%

For Symfony 2.1.x

# in app/config.yml

framework:
    default_locale: %locale%

The %locale% parameter would typically be defined in your parameters.ini file, but there's nothing to stop you just specifying "en" (or "fr" in your case I'm guessing) directly.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM