4

Rails 3.2 アプリケーションがあります。ko と en の 2 つのロケールがあります。ko がデフォルトですが、利用できない場合は en にフォールバックしたいと考えています。フォールバックは開発環境では機能しますが、本番環境では機能しません。

[config/application.rb]
    config.i18n.default_locale = :ko
    config.i18n.fallbacks = [:en]

[config/environments/production.rb]
  config.i18n.fallbacks = true


[config/locales/en.yml]
  ttt: TTT

[config/locales/ko.yml]
  (ttt is not defined)


**In development console:**

I18n.locale #=> :ko
I18n.t("ttt") #=> "TTT" (Works fine)


**In production console:**

I18n.locale #=> :ko
I18n.t("ttt") #=> "translation missing: ko.ttt" (Not working)

私は何が欠けていますか?

4

2 に答える 2

7

本番/ステージング環境でコメントアウトするconfig.i18n.fallbacks = trueと、期待どおりに機能します。

于 2014-01-06T14:12:54.860 に答える