mirror of
https://github.com/facebook/sapling.git
synced 2024-10-06 23:07:18 +03:00
i18n: do not abuse msgstr of "DEPRECATED" to check for bad translation
Because f94973e0eefb 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".
This commit is contained in:
parent
56dfb9561e
commit
1a1642aa7c
@ -71,9 +71,7 @@ def promptchoice(pe):
|
||||
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 deprecatedsetup(pofile):
|
||||
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)',
|
||||
|
Loading…
Reference in New Issue
Block a user