共享 Active Record 属性翻译的最佳实践

Best practice for sharing translation of Active Record attributes

我的一个翻译文件中有以下 yaml:

se:
  activerecord:
    attributes:
      user:
        name: "Namn"
        town: "Stad"
      admin:
        name: "Namn"
        level: "Nivå"
      pet:
        name: "Namn"
      company:
        name: "Namn"
      food:
        name: "Namn"

有没有办法让我干掉它并在所有模型中共享 name 的翻译?如果我可以完全删除 petcompanyfood 的条目,则会加分。

se:
  common: &common
    name: "Namn"
  activerecord:
    attributes:
      user:
        <<: *common
        town: "Stad"
      admin:
        <<: *common
        level: "Nivå"
      pet:
        <<: *common
      company:
        <<: *common
      food:
        <<: *common