rails-i18n

how to use rails i18n fallback features

Deadly 提交于 2019-11-26 16:48:56
问题 I have this i18n problem activerecord: notices: messages: success: create: "Something was created" models: user: success: create: "Thanks for registration" I18n.t("activerecord.notices.models.user.success.create") # => "Thanks for registration" I18n.t("activerecord.notices.models.book.success.create") # => "translation missing: de, activerecord, notices, models, book, success, create" I don't know why the book model doesn't get the fallback massage. I have set config.i18n.fallbacks = true . I

Rails I18n validation deprecation warning

落爺英雄遲暮 提交于 2019-11-26 11:44:43
问题 I just updated to rails 4.0.2 and I\'m getting this warning: [deprecated] I18n.enforce_available_locales will default to true in the future. If you really want to skip validation of your locale you can set I18n.enforce_available_locales = false to avoid this message. Is there any security issue in setting it to false? 回答1: Important : Make sure your app is not using I18n 0.6.8, it has a bug that prevents the configuration to be set correctly. Short answer In order to silence the warning edit