diff options
Diffstat (limited to 'src/zope/i18n/tests/test_translationdomain.py')
-rw-r--r-- | src/zope/i18n/tests/test_translationdomain.py | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/src/zope/i18n/tests/test_translationdomain.py b/src/zope/i18n/tests/test_translationdomain.py index f206d5b..f8efbd9 100644 --- a/src/zope/i18n/tests/test_translationdomain.py +++ b/src/zope/i18n/tests/test_translationdomain.py @@ -113,21 +113,23 @@ class TestGlobalTranslationDomain(TestITranslationDomain, unittest.TestCase): msgid2.mapping['msg1'] = msgid1 self.assertRaises(ValueError, translate, msgid1, None, None, 'en', "default") - # Recusrive translations also work if the original message id wasn't a - # message id but a unicode with a directly passed mapping - self.assertEqual("Color: BLUE/YELLOW", - translate(u"Color: ${color1}/${color2}", mapping=mapping, - target_language='en')) - - # If we have mapping with a message id from a different domain, make sure - # we use that domain, not ours. If the message domain is not registered yet, - # we should return a defualt translation. + # Recursive translations also work if the original message id wasn't a + # message id but a Unicode with a directly passed mapping + self.assertEqual( + "Color: BLUE/YELLOW", + translate(u"Color: ${color1}/${color2}", mapping=mapping, + target_language='en')) + + # If we have mapping with a message id from a different + # domain, make sure we use that domain, not ours. If the + # message domain is not registered yet, we should return a + # default translation. alt_factory = MessageFactory('alt') msgid_sub = alt_factory(u"special", default=u"oohhh") mapping = {'message': msgid_sub} msgid = factory(u"46-not-there", 'Message: ${message}', mapping=mapping) - # test we get a default with no domain registerd + # test we get a default with no domain registered self.assertEqual( translate(msgid, target_language='en', default="default"), "Message: oohhh") |