From b4f35ce6103d222e96d9153d5801044016329953 Mon Sep 17 00:00:00 2001 From: elijah Date: Tue, 14 Jul 2015 13:59:27 -0700 Subject: a couple minor fixes for l10n --- config/environments/development.rb | 3 +++ config/initializers/i18n.rb | 6 ++++++ 2 files changed, 9 insertions(+) (limited to 'config') diff --git a/config/environments/development.rb b/config/environments/development.rb index 7b06c81..f088ef2 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -22,6 +22,9 @@ LeapWeb::Application.configure do # Only use best-standards-support built into browsers config.action_dispatch.best_standards_support = :builtin + # Enable locale fallbacks for I18n (makes lookups for any locale fall back to + # the I18n.default_locale when a translation can not be found) + config.i18n.fallbacks = true # Do not compress assets config.assets.compress = false diff --git a/config/initializers/i18n.rb b/config/initializers/i18n.rb index 645e370..ad8edd5 100644 --- a/config/initializers/i18n.rb +++ b/config/initializers/i18n.rb @@ -6,3 +6,9 @@ I18n.load_path += Dir[Rails.root.join('config', 'locales', 'en', '*.yml')] # enable using the cascade option # see svenfuchs.com/2011/2/11/organizing-translations-with-i18n-cascade-and-i18n-missingtranslations I18n::Backend::Simple.send(:include, I18n::Backend::Cascade) + +# can't get this working +# I18n.available_locales << :'pt-BR' +#require "i18n/backend/fallbacks" +#I18n::Backend::Simple.send(:include, I18n::Backend::Fallbacks) +#I18n.fallbacks.map(:ca => :es, :pt => :'pt-BR') \ No newline at end of file -- cgit v1.2.3