Ticket #11966: 11966.patch
File 11966.patch, 2.3 KB (added by , 14 years ago) |
---|
-
django/utils/translation/trans_real.py
443 461 else: 444 462 singular.append('%%(%s)s' % t.contents) 445 463 elif t.token_type == TOKEN_TEXT: 464 contents = t.contents.replace('%', '%%') 446 465 if inplural: 447 plural.append( t.contents)466 plural.append(contents) 448 467 else: 449 singular.append( t.contents)468 singular.append(contents) 450 469 else: 451 470 if t.token_type == TOKEN_BLOCK: 452 471 imatch = inline_re.match(t.contents) -
tests/regressiontests/i18n/commands/extraction.py
34 34 return self.assert_(not re.search('^msgid "%s"' % msgid, s, re.MULTILINE)) 35 35 36 36 37 class TemplateExtractorTests(ExtractorTests): 38 39 def test_templatize(self): 40 os.chdir(self.test_dir) 41 management.call_command('makemessages', locale=LOCALE, verbosity=0) 42 self.assert_(os.path.exists(self.PO_FILE)) 43 po_contents = open(self.PO_FILE, 'r').read() 44 self.assertMsgId('I think that 100%% is more that 50%% of anything.', po_contents) 45 self.assertMsgId('I think that 100%% is more that 50%% of %\(obj\)s.', po_contents) 46 47 37 48 class JavascriptExtractorTests(ExtractorTests): 38 49 39 50 PO_FILE='locale/%s/LC_MESSAGES/djangojs.po' % LOCALE -
tests/regressiontests/i18n/commands/templates/test.html
1 1 {% load i18n %} 2 {% trans "This literal should be included." %} 3 No newline at end of file 2 {% trans "This literal should be included." %} 3 {% blocktrans %}I think that 100% is more that 50% of anything.{% endblocktrans %} 4 {% blocktrans with 'txt' as obj %}I think that 100% is more that 50% of {{ obj }}.{% endblocktrans %}