i18n: calculate correct line number in source of messages to be translated
authorFUJIWARA Katsunori <foozy@lares.dti.ne.jp>
Thu, 11 Feb 2016 23:15:34 +0900
changeset 28074 a1924bc6e267
parent 28073 c4bec3c45ec9
child 28075 63eae465095e
i18n: calculate correct line number in source of messages to be translated Before this patch, line number in source of the message to be translated is wrong in hg.pot, if corresponded message is placed after ".. DIRECTIVE::", because number of lines related to such directive isn't added to variable "delta", which holds number of untranslated lines in given text. This patch always adds "2" to "delta", because text block is split into translation units by "\n\n".
i18n/posplit
--- a/i18n/posplit	Wed Feb 10 12:39:25 2016 -0800
+++ b/i18n/posplit	Thu Feb 11 23:15:34 2016 +0900
@@ -57,11 +57,13 @@
                 if mdirective:
                     if not msgid[mdirective.end():].rstrip():
                         # only directive, nothing to translate here
+                        delta += 2
                         continue
                     directive = mdirective.group(1)
                     if directive in ('container', 'include'):
                         if msgid.rstrip('\n').count('\n') == 0:
                             # only rst syntax, nothing to translate
+                            delta += 2
                             continue
                         else:
                             # lines following directly, unexpected