Permalink
Browse files

Failing test for npgettext with msgcntxt. Refs #116.

  • Loading branch information...
1 parent da09d52 commit e590b8c079fbb0b71b5011f0be9ae872ddd3e1c7 @nikosd nikosd committed Nov 7, 2011
Showing with 18 additions and 0 deletions.
  1. +8 −0 test/gettext/backend_test.rb
  2. +10 −0 test/test_data/locales/de.po
@@ -43,11 +43,13 @@ def test_looks_up_a_namespaced_translation
I18n.locale = :de
assert_equal 'Räderzahl', sgettext('Car|Wheels count')
assert_equal 'Räderzahl', pgettext('Car', 'Wheels count')
+ assert_equal 'Räderzahl!', pgettext('New car', 'Wheels count')
end
def test_uses_namespaced_default_translation
assert_equal 'Wheels count', sgettext('Car|Wheels count')
assert_equal 'Wheels count', pgettext('Car', 'Wheels count')
+ assert_equal 'Wheels count', pgettext('New car', 'Wheels count')
end
def test_pluralizes_entry
@@ -67,13 +69,17 @@ def test_pluralizes_namespaced_entry
assert_equal 'Räder', nsgettext('Car|wheel', 'wheels', 2)
assert_equal 'Rad', npgettext('Car', 'wheel', 'wheels', 1)
assert_equal 'Räder', npgettext('Car', 'wheel', 'wheels', 2)
+ assert_equal 'Rad!', npgettext('New car', 'wheel', 'wheels', 1)
+ assert_equal 'Räder!', npgettext('New car', 'wheel', 'wheels', 2)
end
def test_pluralizes_namespaced_default_entry
assert_equal 'wheel', nsgettext('Car|wheel', 'wheels', 1)
assert_equal 'wheels', nsgettext('Car|wheel', 'wheels', 2)
assert_equal 'wheel', npgettext('Car', 'wheel', 'wheels', 1)
assert_equal 'wheels', npgettext('Car', 'wheel', 'wheels', 2)
+ assert_equal 'wheel', npgettext('New car', 'wheel', 'wheels', 1)
+ assert_equal 'wheels', npgettext('New car', 'wheel', 'wheels', 2)
end
def test_pluralizes_namespaced_entry_with_alternative_syntax
@@ -82,6 +88,8 @@ def test_pluralizes_namespaced_entry_with_alternative_syntax
assert_equal 'Räder', nsgettext(['Car|wheel', 'wheels'], 2)
assert_equal 'Rad', npgettext('Car', ['wheel', 'wheels'], 1)
assert_equal 'Räder', npgettext('Car', ['wheel', 'wheels'], 2)
+ assert_equal 'Rad!', npgettext('New car', ['wheel', 'wheels'], 1)
+ assert_equal 'Räder!', npgettext('New car', ['wheel', 'wheels'], 2)
end
def test_ngettextpluralizes_entry_with_dots
@@ -42,6 +42,10 @@ msgstr "Modell"
msgid "Car|Wheels count"
msgstr "Räderzahl"
+msgctxt "New car"
+msgid "Wheels count"
+msgstr "Räderzahl!"
+
#: app/views/cars/show.html.erb:7
msgid "Created"
msgstr "Erstellt"
@@ -66,6 +70,12 @@ msgid_plural "Car|wheels"
msgstr[0] "Rad"
msgstr[1] "Räder"
+msgctxt "New car"
+msgid "wheel"
+msgid_plural "wheels"
+msgstr[0] "Rad!"
+msgstr[1] "Räder!"
+
msgid "On %{count} wheel."
msgid_plural "On %{count} wheels."
msgstr[0] "Auf %{count} Achse."

0 comments on commit e590b8c

Please sign in to comment.