【问题标题】:Translating mongoid to german将 mongoid 翻译成德语
【发布时间】:2012-03-22 16:00:10
【问题描述】:

我在翻译 mongoid 中的默认验证消息时遇到问题。
我用

创建了一个 /config/initializers/mongoid.rb
  • Mongoid.add_language("de")

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

但是每次调用经过验证的字段都会出现翻译错误:

  • 翻译缺失:de.mongoid.errors.models.comment.attributes.body.too_short
  • 翻译缺失:de.mongoid.errors.models.user.attributes.username.blank

我有

  • Ruy on Rails 3.2
  • Ruby 1.9.3
  • mongoid 2.4.7

【问题讨论】:

    标签: ruby-on-rails ruby-on-rails-3 mongoid


    【解决方案1】:

    如果你查看 Mongoid 源代码,你可以看到 de.yml 语言环境文件没有翻译这两个键:

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

    你可以在 Mongoid 2.4.0-stable 分支上做一些 pull_request 来添加它。

    【讨论】:

    • Biig thx(“我想知道为什么一两个翻译工作正常:D ^^”)
    • too_short 键即使不是英语语言环境。空白可能是一个错误/忘记。 Durran 现在住在柏林。
    猜你喜欢
    • 1970-01-01
    • 2018-05-09
    • 1970-01-01
    • 2011-10-24
    • 1970-01-01
    • 2019-09-12
    • 1970-01-01
    • 1970-01-01
    • 2013-01-07
    相关资源
    最近更新 更多