Skip to content

Commit 13927ad

Browse files
Tomas's suggestions
1 parent f15971a commit 13927ad

File tree

4 files changed

+18
-20
lines changed

4 files changed

+18
-20
lines changed
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#: noheader.py:3
2+
msgid "Foo"
3+
msgstr ""
4+
5+
#: noheader.py:5
6+
msgid "Bar"
7+
msgstr ""
8+
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
from gettext import gettext as _
2+
3+
_('Foo')
4+
5+
_('Bar')

Lib/test/test_tools/test_i18n.py

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -516,22 +516,6 @@ def test_parse_keyword_spec(self):
516516
parse_spec(spec)
517517
self.assertEqual(str(cm.exception), message)
518518

519-
def test_omit_header(self):
520-
"""Test that --omit-header removes the header."""
521-
data = self.extract_from_str(dedent('''\
522-
_("foo")
523-
'''), args=('--omit-header',), raw=True)
524-
525-
self.assertNotIn("Project-Id-Version", data)
526-
self.assertNotIn("POT-Creation-Date", data)
527-
self.assertNotIn("PO-Revision-Date", data)
528-
self.assertNotIn("Last-Translator", data)
529-
self.assertNotIn("Language-Team", data)
530-
self.assertNotIn("MIME-Version", data)
531-
self.assertNotIn("Content-Type", data)
532-
self.assertNotIn("Content-Transfer-Encoding", data)
533-
self.assertNotIn("Generated-By", data)
534-
535519

536520
def extract_from_snapshots():
537521
snapshots = {
@@ -542,6 +526,7 @@ def extract_from_snapshots():
542526
'custom_keywords.py': ('--keyword=foo', '--keyword=nfoo:1,2',
543527
'--keyword=pfoo:1c,2',
544528
'--keyword=npfoo:1c,2,3'),
529+
'noheader.py': ('--omit-header',),
545530
}
546531

547532
for filename, args in snapshots.items():

Tools/i18n/pygettext.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -125,13 +125,13 @@
125125
Set width of output to columns.
126126
127127
--omit-header
128-
Don’t write header to file.
128+
Do not write header to file.
129129
130130
This is useful for testing purposes because it eliminates a source of
131-
variance for generated .gmo files.
131+
variance for generated .mo files.
132132
133-
Note: Using this option will lead to an error if the resulting file
134-
would not entirely be in ASCII.
133+
Note: Using this option will lead to an error during compilation or other
134+
manipulation if the resulting file is not entirely in ASCII.
135135
136136
-x filename
137137
--exclude-file=filename

0 commit comments

Comments
 (0)