【问题标题】:How to set title_create and button name in SonataAdminBundle?如何在 SonataAdminBundle 中设置 title_create 和按钮名称?
【发布时间】:2018-11-16 23:00:05
【问题描述】:

我正在使用 SonataAdminBundle,但我不知道在制作表单时如何更改按钮名称和 title_create。我认为这很容易做到,但我在官方文档中一无所获。我想我必须更改我的 config.yml.. 在此先感谢。

【问题讨论】:

    标签: symfony sonata


    【解决方案1】:

    您可以定义自己的翻译

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

    假设您使用新的应用程序结构,用于德语翻译并使用 yaml:

    使用

    创建文件 ${APP_ROOT}/translations/SonataAdminBundle.de.yml
    title_create: your own create title
    

    对于 yaml 以外的格式,请参阅 https://symfony.com/doc/current/translation.html#translation-resources

    创建文件后不要忘记清除缓存!

    php bin/console cache:clear
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-11-16
      • 2022-06-15
      • 1970-01-01
      • 2012-12-17
      • 2020-08-06
      • 1970-01-01
      相关资源
      最近更新 更多