Skip to content

Commit

Permalink
Check for PO header in input
Browse files Browse the repository at this point in the history
  • Loading branch information
friedelwolff committed Feb 17, 2017
1 parent a4ac704 commit 81ae442
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions translate/tools/posegment.py
Expand Up @@ -25,7 +25,7 @@
"""

from translate.lang import factory as lang_factory
from translate.storage import factory
from translate.storage import factory, poheader


class segment:
Expand Down Expand Up @@ -62,9 +62,11 @@ def segmentunit(self, unit):

def convertstore(self, fromstore):
tostore = type(fromstore)()
# We don't want the default header in the case of PO, but rather the
# one from `fromstore`.
tostore.units = []
if isinstance(fromstore, poheader.poheader):
# We don't want the default header in the case of PO, but rather the
# one from `fromstore`.
if fromstore.header() is not None:
tostore.units = []
for unit in fromstore.units:
newunits = self.segmentunit(unit)
if newunits:
Expand Down

0 comments on commit 81ae442

Please sign in to comment.