summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCédric Krier <ced@b2ck.com>2019-03-01 09:43:00 +0100
committerAarni Koskela <akx@iki.fi>2019-03-01 12:59:12 +0200
commit60af039d9b282b46e37f6f8556005c339f5c24a2 (patch)
tree77048e54fd82264b32d2374f32942102015400b2
parent60669579a7e3189112ce4ecb983928040af79e73 (diff)
downloadbabel-60af039d9b282b46e37f6f8556005c339f5c24a2.tar.gz
frontend: Add omit-header to update_catalog
It is the same option as in extract_message but for when updating the catalog.
-rw-r--r--babel/messages/frontend.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/babel/messages/frontend.py b/babel/messages/frontend.py
index 9213cca..f673f90 100644
--- a/babel/messages/frontend.py
+++ b/babel/messages/frontend.py
@@ -647,6 +647,8 @@ class update_catalog(Command):
('output-file=', 'o',
"name of the output file (default "
"'<output_dir>/<locale>/LC_MESSAGES/<domain>.po')"),
+ ('omit-header', None,
+ "do not include msgid "" entry in header"),
('locale=', 'l',
'locale of the catalog to compile'),
('width=', 'w',
@@ -661,15 +663,19 @@ class update_catalog(Command):
('update-header-comment', None,
'update target header comment'),
('previous', None,
- 'keep previous msgids of translated messages')
+ 'keep previous msgids of translated messages'),
+ ]
+ boolean_options = [
+ 'omit-header', 'no-wrap', 'ignore-obsolete', 'no-fuzzy-matching',
+ 'previous', 'update-header-comment',
]
- boolean_options = ['no-wrap', 'ignore-obsolete', 'no-fuzzy-matching', 'previous', 'update-header-comment']
def initialize_options(self):
self.domain = 'messages'
self.input_file = None
self.output_dir = None
self.output_file = None
+ self.omit_header = False
self.locale = None
self.width = None
self.no_wrap = False
@@ -740,6 +746,7 @@ class update_catalog(Command):
try:
with open(tmpname, 'wb') as tmpfile:
write_po(tmpfile, catalog,
+ omit_header=self.omit_header,
ignore_obsolete=self.ignore_obsolete,
include_previous=self.previous, width=self.width)
except: