How to overwrite FOS user bundle form labels

后端 未结 2 2148
忘掉有多难
忘掉有多难 2021-02-13 21:14

I have a hard time overwriting labels that the FOS user bundle for Symfony2 uses.

I\'m already overwriting the Form class, but there is no option for elements like \"set

2条回答
  •  醉梦人生
    2021-02-13 21:42

    You don't need to overwrite Form classes.

    Copy/paste vendor/friendsofsymfony/user-bundle/FOS/UserBundle/Resources/translations/FOSUserBundle.xx.yml files in your app/Resources/translations directory (with the same directory structure and the same file name) and redefine translations to your convenience.

    edit: As told by @mario-johnathan, overriding translations is not part of bundle inheritance. See http://symfony.com/doc/current/cookbook/bundles/override.html#translations for official documentation

提交回复
热议问题