Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(10)

Issue 65: xliff2po & po2xliff should handle context

Unified Diff

File: translate/storage/xliff.py
Patch Set: A more complete patch, supporting CPO and pypo Created 1 year, 4 months ago
Jump to:
View side by-side-diff with in line comments
« translate/storage/test_xliff.py ('k') | no next file »
Index: translate/storage/xliff.py
===================================================================
--- translate/storage/xliff.py	(revision 7897)
+++ translate/storage/xliff.py	(working copy)
@@ -283,6 +283,17 @@
                 groups.append(pairs) #not extend
         return groups
         
+    def delcontextgroup(self, name):
+        """Removes all the context groups with the specified name"""
+        #XXX: I really not sure about this behavior, maybe we should remove
+        #     only the first group with the given name
+        grouptags = self.xmlelement.findall(
+            ".//%s" % self.namespaced("context-group"))
+        for group in grouptags:
+            if group.get("name") == name:
+                self.xmlelement.remove(group)
+                # break
+
     def getrestype(self):
         """returns the restype attribute in the trans-unit tag"""
         return self.xmlelement.get("restype")

« translate/storage/test_xliff.py ('k') | no next file »

Powered by Google App Engine
This is Rietveld r159