Translating mongoid to german

試著忘記壹切 提交于 2019-12-23 04:08:33

问题


I got a problem to translate the default validation messages in mongoid.
I create a /config/initializers/mongoid.rb with

  • Mongoid.add_language("de")

http://mongoid.org/docs/installation/languages.html

But every call on a validated field i got translation errors:

  • translation missing: de.mongoid.errors.models.comment.attributes.body.too_short
  • translation missing: de.mongoid.errors.models.user.attributes.username.blank

I have

  • Ruy on Rails 3.2
  • Ruby 1.9.3
  • mongoid 2.4.7

回答1:


If you check on Mongoid source, the de.yml locale file you can see this two key are not translate :

https://github.com/mongoid/mongoid/blob/2.4.0-stable/lib/config/locales/de.yml

You can do some pull_request on Mongoid 2.4.0-stable branch to add it.



来源:https://stackoverflow.com/questions/9826032/translating-mongoid-to-german

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