implement both "traditional" and "simplfied" Chinese -- partial

This commit is contained in:
Anthony Fok 2015-03-05 16:57:46 -08:00 committed by Paul Franklin
parent 9335a21e3a
commit 2da2bcdeac

View File

@ -184,11 +184,19 @@ class Check_last_char( Check ):
def __process( self, msg, msgid, msgstr ): def __process( self, msg, msgid, msgstr ):
msgid_last = msgid[-1:] msgid_last = msgid[-1:]
msgstr_last = msgstr[-1:] msgstr_last = unicode(msgstr, encoding='utf-8')[-1:]
if msgid_last.isspace() != msgstr_last.isspace(): if msgid_last.isspace() != msgstr_last.isspace():
self.msgs.append( msg ) self.msgs.append( msg )
elif (msgid_last == '.') != (msgstr_last == '.'): elif (msgid_last == '.') != (msgstr_last == '.' or
msgstr_last == u'\u3002' ): # Chinese
self.msgs.append( msg ) self.msgs.append( msg )
elif (msgid_last == ':') != (msgstr_last == ':' or
msgstr_last == u'\uff1a' ): # Chinese
self.msgs.append( msg )
elif (msgid_last == ')') != (msgstr_last == ')' or
msgstr_last == u'\uff09' ): # Chinese
self.msgs.append( msg )
def process( self, msg ): def process( self, msg ):
# Last character of msgid? White space? Period? # Last character of msgid? White space? Period?