【问题标题】:How to translate ActiveStorage attribute如何翻译 ActiveStorage 属性
【发布时间】:2019-05-02 08:32:04
【问题描述】:

我的模型 Order 有很多文本,每个文本可以有一个附加文档 (has_one_attached(:document))。 有时,基本错误是Texts document,有时是document...

我想翻译,但不知道怎么翻译。

这是我的activerecord.fr.yml

fr:
  activerecord:
    errors:
      models:
        text:
          attributes:
            document: 'blabla'
            texts_document: 'test'

但它不起作用。我也试过这个:

fr:
  activerecord:
    errors:
      models:
        order:
          attributes:
            texts:
             document: 'blabla'
             texts_document: 'test'

有什么想法吗?

【问题讨论】:

    标签: ruby-on-rails internationalization rails-i18n rails-activestorage


    【解决方案1】:
    fr:
      activerecord:
        models:
          order: "l'ordre"
          text: le texte
        attributes:
          text:
            document: le document
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2012-06-14
      • 2018-05-05
      • 1970-01-01
      • 1970-01-01
      • 2015-06-18
      • 2015-06-26
      • 1970-01-01
      相关资源
      最近更新 更多