【问题标题】:where to set locale_backend to comply with new changes in money-rails?在哪里设置 locale_backend 以符合货币轨道的新变化?
【发布时间】:2018-12-01 05:35:40
【问题描述】:

money-rails gem 会抛出以下警告

 [DEPRECATION] You are using the default localization behaviour that will change in the next major release. Find out more - https://github.com/RubyMoney/money#deprecation

文档说要设置:

 Money.locale_backend = :i18n

还有,添加:

en:
  number:
    currency:
      format:
      delimiter: ","
      separator: "."

# falling back to
number:
  format:
    delimiter: ","
    separator: "."

更新 en.yml 文件是不言自明的。但是,文档并不清楚在哪里设置 Money.locale_backend = :i18n。

这应该在新的初始化程序中吗?

【问题讨论】:

    标签: ruby-on-rails money-rails


    【解决方案1】:

    你可以在config/initializers/money.rb中设置

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2010-10-12
      • 2011-01-05
      • 1970-01-01
      • 2012-01-29
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多