You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I'm running pogrep (specifically with invert-match), I'm getting a resulting po file with two headers. We already discussed it with Friedel on IRC. A quick-and-dirty patch:
--- /home/users/claudep/pogrep.py 2012-03-13 12:21:34.000000000 +0000+++ python-packages/lib/python2.6/dist-packages/translate/tools/pogrep.py 2011-06-22 17:47:35.000000000 +0000@@ -216,6 +216,7 @@
def filterfile(self, thefile):
"""runs filters on a translation file object"""
thenewfile = type(thefile)()
- thenewfile.units = []
thenewfile.setsourcelanguage(thefile.sourcelanguage)
thenewfile.settargetlanguage(thefile.targetlanguage)
for unit in thefile.units:
Another try at higher level:
--- translate/storage/base.py 2011-05-15 20:14:19.000000000 +0200+++ /home/claude/.../translate/storage/base.py 2012-03-13 14:17:21.759808031 +0100@@ -543,6 +543,9 @@
@param unit: The unit that will be added.
"""
unit._store = self
- # Prevent two header units in the same store- if unit.isheader() and len(self.units) and self.units[0].isheader():- self.units[0] = unit- else:- self.units.append(unit)-
self.units.append(unit)
def addsourceunit(self, source):
The text was updated successfully, but these errors were encountered:
From a quick look, I think your second approach is good, except that it should only be done for PO clases (we have a few). So we could maybe put this in pocommon, but at least cpo.py currently also overrides addunit, so we might want to fix it there as well.
Version: trunk
When I'm running pogrep (specifically with invert-match), I'm getting a resulting po file with two headers. We already discussed it with Friedel on IRC. A quick-and-dirty patch:
Another try at higher level:
The text was updated successfully, but these errors were encountered: