comparison i18n/check-translation.py @ 40185:19fc5a986669

polib: update to latest release 1.0.7 (upstream rev d75ce6dbbc2a) # no-check-commit third-party code that doesn't match our style Differential Revision: https://phab.mercurial-scm.org/D5001
author Augie Fackler <augie@google.com>
date Fri, 12 Oct 2018 11:44:27 -0400
parents 078099304772
children 2372284d9457
comparison
equal deleted inserted replaced
40184:c3b7d9c54edd 40185:19fc5a986669
222 del os.environ['TERM'] 222 del os.environ['TERM']
223 import doctest 223 import doctest
224 failures, tests = doctest.testmod() 224 failures, tests = doctest.testmod()
225 sys.exit(failures and 1 or 0) 225 sys.exit(failures and 1 or 0)
226 226
227 # replace polib._POFileParser to show linenum of problematic msgstr
228 class ExtPOFileParser(polib._POFileParser):
229 def process(self, symbol, linenum):
230 super(ExtPOFileParser, self).process(symbol, linenum)
231 if symbol == 'MS': # msgstr
232 self.current_entry.linenum = linenum
233 polib._POFileParser = ExtPOFileParser
234
235 detected = [] 227 detected = []
236 warning = options.warning 228 warning = options.warning
237 for f in args: 229 for f in args:
238 detected.extend((f, pe, errors) 230 detected.extend((f, pe, errors)
239 for pe, errors in check(polib.pofile(f), 231 for pe, errors in check(polib.pofile(f),