Ruby On Rails: pluralize for other languages

前端 未结 4 2136
悲&欢浪女
悲&欢浪女 2021-02-14 19:57

I am building apps for a non-english audience. Right now, I use english nouns to name my models, yet I prefer to use native dutch ones. As the convention uses the plural of the

4条回答
  •  太阳男子
    2021-02-14 20:51

    Add your rules to an inflections.rb file in config/initializers. See the API documentation:

    ActiveSupport::Inflector.inflections do |inflect|
      inflect.plural 'boek', 'boeken'
    end
    

提交回复
热议问题