How do you customize transliterations in a Rails 3 app?

不羁的心 提交于 2019-12-06 05:06:40

Ehh, I've got a part of the answer. Unlike what the doc at http://api.rubyonrails.org/classes/ActiveSupport/Inflector.html#method-i-transliterate says, the yml files should still specify the language - i.e. de:

# Store the transliterations in locales/de.yml
de:
  i18n:
    transliterate:
      rule:
        ü: "ue"
        ö: "oe"

Please still answer the second part of the question, where should code like I18n.backend.store_translations(:en,... live in a Rails 3 app?

[...] where should code like I18n.backend.store_translations(:en,... live in a Rails 3 app?

I know. I might be a little late on this but I would put it into an initializer file: config/initializers/i18n.rb

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!