This project is archived and is in readonly mode.

#5785 ✓invalid
PeterisP

config.i18n.fallbacks away from default locale seems to break unit tests

Reported by PeterisP | October 11th, 2010 @ 04:39 PM

Adding a locale fallback seems to break unit tests which check validation failures.

Part of app is localised, but the rest, including all the standard validation messages should fall back to english.

With the following code in application.rb
config.i18n.default_locale = :lv
config.i18n.fallbacks = {:lv => :en}

All the test lines with "assert something.invalid?" fail with error 'I18n::InvalidLocale: nil is not a valid locale'.
Trace(below) doesn't show anything useful.
Removing fallbacks by commenting the fallback line fixes the issue.

Command failed with status (1): [c:/Ruby/bin/ruby.exe -I"lib;test" "c:/Ruby...]
c:/Ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:995
c:/Ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:1010:in call'<br/> c:/Ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:1010:insh'
c:/Ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:1094:in sh'<br/> c:/Ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:1029:inruby'
c:/Ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:1094:in ruby'<br/> c:/Ruby/lib/ruby/gems/1.8/gems/railties-3.0.0/lib/rails/test_unit/testing.rake:26<br/> c:/Ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:1112:inverbose'
c:/Ruby/lib/ruby/gems/1.8/gems/railties-3.0.0/lib/rails/test_unit/testing.rake:11
c:/Ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:636:in call'<br/> c:/Ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:636:inexecute'
c:/Ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:631:in each'<br/> c:/Ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:631:inexecute'
c:/Ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:597:in invoke_with_call_chain'<br/> c:/Ruby/lib/ruby/1.8/monitor.rb:242:insynchronize'
c:/Ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:590:in invoke_with_call_chain'<br/> c:/Ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:583:ininvoke'
c:/Ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2051:in invoke_task'<br/> c:/Ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:intop_level'
c:/Ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in each'<br/> c:/Ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:intop_level'
c:/Ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2068:in standard_exception_handling'<br/> c:/Ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2023:intop_level'
c:/Ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2001:in run'<br/> c:/Ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2068:instandard_exception_handling'
c:/Ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:1998:in run'<br/> c:/Ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/bin/rake:31<br/> c:/Ruby/bin/rake:19:inload'
c:/Ruby/bin/rake:19

Comments and changes to this ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>

Pages