# HG changeset patch # User Yuya Nishihara # Date 1446557966 -32400 # Node ID 3fb36dec172776690129d6dd916bc1dcdeac3b99 # Parent 58b7f3e93bbab749ab16c09df12aae5ba7880708 i18n: do not abuse msgstr of "DEPRECATED" to check for bad translation Because 44cc9f63a2f1 requires the msgstr of "(DEPRECATED)", old *.po files must be blamed. Using "DEPRECATED" would just hide the error. For example, "LANG=da_DK.UTF-8 hg help serve" fails to hide deprecated options right now, but check-translation.py couldn't detect it because da.po has outdated translation of "DEPRECATED". diff -r 58b7f3e93bba -r 3fb36dec1727 i18n/check-translation.py --- a/i18n/check-translation.py Sun Nov 01 13:04:14 2015 -0600 +++ b/i18n/check-translation.py Tue Nov 03 22:39:26 2015 +0900 @@ -71,9 +71,7 @@ deprecatedpe = None @scanner() def deprecatedsetup(pofile): - pes = [p for p in pofile - if ((p.msgid == 'DEPRECATED' or p.msgid == '(DEPRECATED)') and - p.msgstr)] + pes = [p for p in pofile if p.msgid == '(DEPRECATED)' and p.msgstr] if len(pes): global deprecatedpe deprecatedpe = pes[0] @@ -82,8 +80,8 @@ def deprecated(pe): """Check for DEPRECATED >>> ped = polib.POEntry( - ... msgid = 'DEPRECATED', - ... msgstr= 'DETACERPED') + ... msgid = '(DEPRECATED)', + ... msgstr= '(DETACERPED)') >>> deprecatedsetup([ped]) >>> pe = polib.POEntry( ... msgid = 'Something (DEPRECATED)',