mirror of
https://github.com/django/django.git
synced 2025-10-26 15:16:09 +00:00
Fixed #10004 and #12320 -- Enabled the makemessages management command to collect comments for translators that start with the "Translators" keyword. Thanks for the report and patches, martinb and Claude Paroz.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@14595 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
@@ -38,7 +38,18 @@ class ExtractorTests(TestCase):
|
||||
return self.assert_(not re.search('^msgid %s' % msgid, s, re.MULTILINE))
|
||||
|
||||
|
||||
class TemplateExtractorTests(ExtractorTests):
|
||||
class BasicExtractorTests(ExtractorTests):
|
||||
|
||||
def test_comments_extractor(self):
|
||||
os.chdir(self.test_dir)
|
||||
management.call_command('makemessages', locale=LOCALE, verbosity=0)
|
||||
self.assert_(os.path.exists(self.PO_FILE))
|
||||
po_contents = open(self.PO_FILE, 'r').read()
|
||||
self.assert_('#. Translators: This comment should be extracted' in po_contents)
|
||||
self.assert_('This comment should not be extracted' not in po_contents)
|
||||
# Comments in templates
|
||||
self.assert_('#. Translators: Django template comment for translators' in po_contents)
|
||||
self.assert_('#. Translators: Django comment block for translators' in po_contents)
|
||||
|
||||
def test_templatize(self):
|
||||
os.chdir(self.test_dir)
|
||||
|
||||
Reference in New Issue
Block a user