diff --git a/po/check_po b/po/check_po index 71d12c804..622c21dff 100755 --- a/po/check_po +++ b/po/check_po @@ -21,7 +21,6 @@ # # TODO # -# * commandline options (for example, "suppress fuzzies in report") # * Check for HTML text in msgstr when there is none in msgid # * Check for matching HTML tag/endtag in msgstr # * Check for shortcut key (_) presence in both msgid and msgstr @@ -168,6 +167,18 @@ class Check_last_char( Check ): elif (msgid_last == '.') != (msgstr_last == '.'): self.msgs.append( msg ) +class Check_shortcut_trans( Check ): + def __init__( self ): + Check.__init__( self ) + self.diag_header = "-------- shortcut key in translation ---------" + self.summary_text = "Shortcut in msgstr:" + def process( self, msg ): + msgid = msg.msgid() + msgstr = msg.msgstr() + + if msgid.count('_') == 0 and msgstr.count('_') > 0: + self.msgs.append( msg ) + class Msgid: fuzzy_pat = re.compile( 'fuzzy' ) tips_xml_pat = re.compile( r'tips\.xml' ) @@ -403,6 +414,7 @@ def analyze_msgs( options, fname, msgs, nr_templates = None, nth = 0 ): checks.append( Check_runaway() ) checks.append( Check_xml_chars() ) checks.append( Check_last_char() ) + checks.append( Check_shortcut_trans() ) for msg in msgs: msgid = msg.msgid()