'Separate multiple patterns with spaces (default ".* ._")'),
('header-comment=', None,
'header comment for the catalog'),
+ ('last-translator=', None,
+ 'set the name and email of the last translator in output'),
]
boolean_options = [
'no-default-keywords', 'no-location', 'omit-header', 'no-wrap',
'mapping-file': ('--mapping',),
'output-file': ('--output',),
'strip-comments': ('--strip-comment-tags',),
+ 'last-translator': ('--last-translator',),
}
option_choices = {
'add-location': ('full', 'file', 'never'),
self.include_lineno = True
self.ignore_dirs = None
self.header_comment = None
+ self.last_translator = None
def finalize_options(self):
if self.input_dirs:
msgid_bugs_address=self.msgid_bugs_address,
copyright_holder=self.copyright_holder,
charset=self.charset,
- header_comment=(self.header_comment or DEFAULT_HEADER))
+ header_comment=(self.header_comment or DEFAULT_HEADER),
+ last_translator=self.last_translator)
for path, method_map, options_map in mappings:
callback = self._build_callback(path)
assert cmdinst.strip_comments
+def test_extract_cli_knows_dash_dash_last_dash_translator():
+ cmdinst = configure_cli_command('extract --last-translator "FULL NAME EMAIL@ADDRESS" -o foo babel')
+ assert isinstance(cmdinst, ExtractMessages)
+ assert cmdinst.last_translator == "FULL NAME EMAIL@ADDRESS"
+
+
def test_extract_add_location():
cmdinst = configure_cli_command("extract -o foo babel --add-location full")
assert isinstance(cmdinst, ExtractMessages)