Permalink
Browse files

change MissingTranslationData message to "translation missing: foo.bar"

(was "translation missing: foo, bar")
  • Loading branch information...
Sven Fuchs
Sven Fuchs committed Nov 4, 2010
1 parent 3a37a38 commit 68fdfe47952325411afe5942e971ce10b2bdf900
View
@@ -30,7 +30,7 @@ class MissingTranslationData < ArgumentError
def initialize(locale, key, opts = nil)
@key, @locale, @options = key, locale, opts.dup || {}
options.each { |k, v| options[k] = v.inspect if v.is_a?(Proc) }
- super "translation missing: #{keys.join(', ')}"
+ super "translation missing: #{keys.join('.')}"
end
def keys
@@ -7,11 +7,11 @@ def setup
super
I18n.backend.store_translations(:en, :foo => { :bar => 'bar', :baz => 'baz' })
end
-
+
define_method "test defaults: given nil as a key it returns the given default" do
assert_equal 'default', I18n.t(nil, :default => 'default')
end
-
+
define_method "test defaults: given a symbol as a default it translates the symbol" do
assert_equal 'bar', I18n.t(nil, :default => :'foo.bar')
end
View
@@ -30,7 +30,7 @@ def setup
end
define_method "test lookup: given a missing key, no default and no raise option it returns an error message" do
- assert_equal "translation missing: en, missing", I18n.t(:missing)
+ assert_equal "translation missing: en.missing", I18n.t(:missing)
end
define_method "test lookup: given a missing key, no default and the raise option it raises MissingTranslationData" do
@@ -12,14 +12,14 @@ def setup
I18n.t(:'baz.missing', :scope => :'foo.bar', :raise => true)
rescue I18n::MissingTranslationData => exception
end
- assert_equal "translation missing: en, foo, bar, baz, missing", exception.message
+ assert_equal "translation missing: en.foo.bar.baz.missing", exception.message
end
test "exceptions: MissingTranslationData message from #localize includes the given scope and full key" do
begin
I18n.l(Time.now, :format => :foo)
rescue I18n::MissingTranslationData => exception
end
- assert_equal "translation missing: en, time, formats, foo", exception.message
+ assert_equal "translation missing: en.time.formats.foo", exception.message
end
-end
+end
@@ -27,7 +27,7 @@ def test_missing_translation_data_stores_locale_key_and_options
def test_missing_translation_data_message
force_missing_translation_data
rescue I18n::ArgumentError => e
- assert_equal 'translation missing: de, bar, foo', e.message
+ assert_equal 'translation missing: de.bar.foo', e.message
end
def test_invalid_pluralization_data_stores_entry_and_count
View
@@ -177,7 +177,7 @@ def test_translate_with_dot_separated_key_array_and_scope_works
# end
def test_translate_given_a_bogus_key_raises_missing_translation_data
- assert_equal "translation missing: en, bogus", I18n.t(:bogus)
+ assert_equal "translation missing: en.bogus", I18n.t(:bogus)
end
def test_translate_empty_string_raises_argument_error

0 comments on commit 68fdfe4

Please sign in to comment.