Skip to content

Commit

Permalink
Only set a rails default locale when it's present
Browse files Browse the repository at this point in the history
Setting I18n.enforce_available_locales = true would break apps not
setting a default locale via rails config

Fixes #417
  • Loading branch information
huoxito committed Jun 23, 2014
1 parent 5970333 commit e541cc0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/spree_i18n/engine.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class Engine < Rails::Engine

initializer "spree_i18n.environment", :before => :load_config_initializers do |app|
app.config.i18n.fallbacks = true
I18n.locale = app.config.i18n.default_locale
I18n.locale = app.config.i18n.default_locale if app.config.i18n.default_locale
SpreeI18n::Config = SpreeI18n::Configuration.new
end

Expand Down

0 comments on commit e541cc0

Please sign in to comment.