diff --git a/babel/messages/catalog.py b/babel/messages/catalog.py index 5686b3141..d0bf6f910 100644 --- a/babel/messages/catalog.py +++ b/babel/messages/catalog.py @@ -74,7 +74,7 @@ def get_close_matches(word, possibilities, n=3, cutoff=0.6): \% (?:\(([\w]*)\))? ( - [-#0\ +]?(?:\*|[\d]+)? + [-#0+]?(?:\*|[\d]+)? (?:\.(?:\*|[\d]+))? [hlL]? ) diff --git a/babel/messages/frontend.py b/babel/messages/frontend.py index c80bcbeb8..a046f81e4 100644 --- a/babel/messages/frontend.py +++ b/babel/messages/frontend.py @@ -198,13 +198,13 @@ def finalize_options(self): raise OptionError('you must specify either the output file or the base directory') def run(self): - n_errors = 0 + n_warnings = 0 for domain in self.domain: for errors in self._run_domain(domain).values(): - n_errors += len(errors) - if n_errors: - self.log.error('%d errors encountered.', n_errors) - return 1 if n_errors else 0 + n_warnings += len(errors) + if n_warnings: + self.log.warning('%d warnings encountered.', n_warnings) + return 0 def _get_po_mo_triples(self, domain: str): if not self.input_file: @@ -262,7 +262,7 @@ def _run_domain(self, domain): catalogs_and_errors[catalog] = catalog_errors = list(catalog.check()) for message, errors in catalog_errors: for error in errors: - self.log.error('error: %s:%d: %s', po_file, message.lineno, error) + self.log.warning('warning: %s:%d: %s', po_file, message.lineno, error) self.log.info('compiling catalog %s to %s', po_file, mo_file)