2012-03-22 97 views
1

我遇到了一個問題,需要在mongoid中翻譯默認的驗證消息。
我創建將mongoid翻譯成德語

  • Mongoid.add_language( 「德」)

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

但在一個驗證的字段我有翻譯錯誤的每個調用/config/initializers/mongoid.rb :

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

  • 魯伊on Rails的3.2
  • 的Ruby 1.9.3
  • mongoid 2.4.7

回答

3

如果你檢查一下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添加它。

+0

Biig thx(「我想知道爲什麼一兩個翻譯工作正常:D ^^」) – bulleric 2012-03-23 08:55:51

+0

「too_short」鍵即使不是英文語言環境。空白可能是一個錯誤/忘記。杜蘭現居住在柏林。 – shingara 2012-03-23 08:57:01