Show More
@@ -88,6 +88,24 b' def taildoublecolons(pe):' | |||||
88 | if pe.msgid.endswith('::') != pe.msgstr.endswith('::'): |
|
88 | if pe.msgid.endswith('::') != pe.msgstr.endswith('::'): | |
89 | yield "tail '::'-ness differs between msgid and msgstr" |
|
89 | yield "tail '::'-ness differs between msgid and msgstr" | |
90 |
|
90 | |||
|
91 | @warningchecker() | |||
|
92 | def indentation(pe): | |||
|
93 | """Check equality of initial indentation between msgid and msgstr | |||
|
94 | ||||
|
95 | This may report unexpected warning, because this doesn't aware | |||
|
96 | the syntax of rst document and the context of msgstr. | |||
|
97 | ||||
|
98 | >>> pe = polib.POEntry( | |||
|
99 | ... msgid =' indented text', | |||
|
100 | ... msgstr=' narrowed indentation') | |||
|
101 | >>> for e in indentation(pe): print e | |||
|
102 | initial indentation width differs betweeen msgid and msgstr | |||
|
103 | """ | |||
|
104 | idindent = len(pe.msgid) - len(pe.msgid.lstrip()) | |||
|
105 | strindent = len(pe.msgstr) - len(pe.msgstr.lstrip()) | |||
|
106 | if idindent != strindent: | |||
|
107 | yield "initial indentation width differs betweeen msgid and msgstr" | |||
|
108 | ||||
91 | #################### |
|
109 | #################### | |
92 |
|
110 | |||
93 | def check(pofile, fatal=True, warning=False): |
|
111 | def check(pofile, fatal=True, warning=False): |
General Comments 0
You need to be logged in to leave comments.
Login now