Skip to content

Commit

Permalink
Fix #84; set I18n.enforce_available_locales to true
Browse files Browse the repository at this point in the history
This required storing the hsilgne translation before using it. Imagine
that!
  • Loading branch information
tfausak committed Dec 9, 2013
1 parent 86377a5 commit cd169f0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 4 additions & 4 deletions spec/active_interaction/i18n_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -74,20 +74,20 @@ def execute; end
end
end

context 'english'.reverse do
context 'hsilgne' do
include_examples 'translation'

before do
I18n.locale = 'english'.reverse

I18n.backend.store_translations(I18n.locale, active_interaction: {
I18n.backend.store_translations('hsilgne', active_interaction: {
errors: { messages: {
invalid: "%{type} #{'invalid'.reverse}",
invalid_nested: 'invalid_nested'.reverse,
missing: 'missing'.reverse
} },
types: TYPES.reduce({}) { |a, e| a[e] = e.reverse; a }
})

I18n.locale = 'hsilgne'
end
end
end
2 changes: 2 additions & 0 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,5 @@
config.run_all_when_everything_filtered = true
config.filter_run_including :focus
end

I18n.config.enforce_available_locales = true

0 comments on commit cd169f0

Please sign in to comment.