Rails-i18n不会加载翻译

时间:2012-10-31 16:12:55

标签: ruby-on-rails ruby internationalization gem translation

我添加了宝石“rails-i18n”但是当我试图获得“date.order”的转换时。一切都失败了,但是当我在自己的文件应用程序中编写翻译时,它有效吗?

更新10/31/2012 我的宝石文件是:

source 'https://rubygems.org'
gem 'rails', '3.2.8'
group :assets do
  gem 'sass-rails',   '~> 3.2.3'
  gem 'coffee-rails', '~> 3.2.1'
  gem 'uglifier', '>= 1.0.3'
end
gem 'jquery-rails'
gem "mysql2", ">= 0.3.11"
gem "haml", ">= 3.1.7"
gem "haml-rails", ">= 0.3.5", :group => :development
gem "hpricot", ">= 0.8.6", :group => :development
gem "ruby_parser", ">= 2.3.1", :group => :development
gem "rspec-rails", ">= 2.11.4", :group => [:development, :test]
gem "capybara", ">= 1.1.2", :group => :test
gem "email_spec", ">= 1.2.1", :group => :test
gem "factory_girl_rails", ">= 4.1.0", :group => [:development, :test]
gem "bootstrap-sass", ">= 2.1.0.1"
gem "devise", ">= 2.1.2"
gem "cancan", ">= 1.6.8"
gem "rolify", ">= 3.2.0"
gem "simple_form", ">= 2.0.4"
gem "quiet_assets", ">= 1.0.1", :group => :development
gem "therubyracer", ">= 0.10.2", :group => :assets, :platform => :ruby
gem 'i18n'
gem 'rails-i18n'

我的错误在视图中:https://gist.github.com/3990266

1 个答案:

答案 0 :(得分:0)

我发现你绝对不能写

en:
  date: Date

在你自己的翻译中会引起很多错误...