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

Issue 65: xliff2po & po2xliff should handle context

Unified Diff

File: translate/convert/test_xliff2po.py
Patch Set: Created 1 year, 4 months ago
Jump to:
View side by-side-diff with in line comments
Index: translate/convert/test_xliff2po.py
===================================================================
--- translate/convert/test_xliff2po.py	(revision 7848)
+++ translate/convert/test_xliff2po.py	(working copy)
@@ -170,7 +170,20 @@
         assert potext.index('msgstr[0] "inkomo"')
         assert potext.index('msgstr[1] "iinkomo"')
 
+    def test_xliff_with_context(self):
+        """tests if we support context strings"""
+        minixlf = self.xliffskeleton % '''<trans-unit id="1">
+        <source>gold</source>
+        <target>ouro</target>
+        <context-group name="po-1025" purpose="match information">
+            <context context-type="x-unknown">the precious</context>
+        </context-group>
+</trans-unit>'''
+        pofile = self.xliff2po(minixlf)
+        unit = pofile.units[0]
+        assert unit.getcontext() == "the precious"
 
+
 class TestBasicXLIFF2PO(TestXLIFF2PO):
     """This tests a basic XLIFF file without xmlns attribute"""
 

Powered by Google App Engine
This is Rietveld r159