Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwalter_l <walter_l@54714841-351b-0410-a198-e36a94b762f5>2009-12-02 15:26:25 (GMT)
committer Sayamindu Dasgupta <sayamindu@gmail.com>2010-01-09 09:11:51 (GMT)
commitbd91ac69061f0e90e3347115204a6aa861f51351 (patch)
tree5849d0c560d4ba2501648f18121e4d0f8e879039
parentd6ef7b26b148d69454e3fcb068c567c13ac3b67e (diff)
Enumerate the strings we iterate over to get a valid plural number (n).
git-svn-id: https://translate.svn.sourceforge.net/svnroot/translate/src/trunk/translate@13441 54714841-351b-0410-a198-e36a94b762f5
-rw-r--r--translate-toolkit-1.5.1/translate/tools/pogrep.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/translate-toolkit-1.5.1/translate/tools/pogrep.py b/translate-toolkit-1.5.1/translate/tools/pogrep.py
index 9f6136e..9582f30 100644
--- a/translate-toolkit-1.5.1/translate/tools/pogrep.py
+++ b/translate-toolkit-1.5.1/translate/tools/pogrep.py
@@ -110,15 +110,14 @@ def real_index(string, nfc_index):
def find_matches(unit, part, strings, re_search):
"""Return the GrepFilter objects where re_search matches in strings."""
matches = []
- part_n = 0
- for string in strings:
+ for n, string in enumerate(strings):
if not string:
continue
normalized = data.normalize(string)
for matchobj in re_search.finditer(normalized):
start = real_index(string, matchobj.start())
end = real_index(string, matchobj.end())
- matches.append(GrepMatch(unit, part=part, part_n=part_n, start=start, end=end))
+ matches.append(GrepMatch(unit, part=part, part_n=n, start=start, end=end))
return matches
class GrepFilter: