Search code examples
symfonysonata

How to set title_create and button name in SonataAdminBundle?


I am using SonataAdminBundle and I don't know how to change my button name and my title_create when I make a Form. I think that is easy to do but I find nothing on the official documentation. I suppose than I have to change my config.yml.. Thanks in advance.


Solution

  • you can define your own translations

    //copied from profiler
    Locale | Domain            |Times used | Message ID   | Message Preview
    de     | SonataAdminBundle |    2      | title_create | Hinzufügen
    

    assuming you use the new app structure, for german translation and using yaml:

    create a file ${APP_ROOT}/translations/SonataAdminBundle.de.yml with

    title_create: your own create title
    

    for a format other than yaml see https://symfony.com/doc/current/translation.html#translation-resources

    don't forget to clear your cache after you created the file!

    php bin/console cache:clear