I18n for model-specific Rails submit button

前端 未结 2 550
广开言路
广开言路 2021-01-01 09:33

I\'ve found that Rails allows for generic i18n of submit buttons via the following in config/locales/en.yml:

en:
  helpers:
    submit:
      cr         


        
2条回答
  •  一个人的身影
    2021-01-01 10:16

    From the source code, it looks like you should be able to do this:

    en:
      helpers:
        submit:
          post:
            create: "Upload %{model}"
    

    where post is the name of your model. The inline docs also mention that you can do this.

提交回复
热议问题