From: Cédric Krier Date: Fri, 1 Mar 2019 08:43:00 +0000 (+0100) Subject: frontend: Add omit-header to update_catalog X-Git-Tag: v2.7.0~14 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=60af039d9b282b46e37f6f8556005c339f5c24a2;p=thirdparty%2Fbabel.git frontend: Add omit-header to update_catalog It is the same option as in extract_message but for when updating the catalog. --- diff --git a/babel/messages/frontend.py b/babel/messages/frontend.py index 9213cca4..f673f900 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 " "'//LC_MESSAGES/.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: