1.#建立翻译文件
比如config/initializers/locale.rb
2.#配置在rails启动文件中
# tell the I18n library where to find your translationsI18n.load_path += Dir[Rails.root.join('lib', 'locale', '*.{rb,yml}')]
# set default locale to something other than :en
I18n.default_locale = :pt
3. 可以在控制器和视图中使用I18n
t翻译
I18n.default_locale
I18n.locale
可赋值可以引用