"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "translate/storage/test_xliff.py" between
translate-toolkit-2.2.4.tar.gz and translate-toolkit-2.2.5.tar.gz

About: Translate Toolkit is a set of software and documentation designed to make localization of software more productive and less frustrating.

test_xliff.py  (translate-toolkit-2.2.4):test_xliff.py  (translate-toolkit-2.2.5)
skipping to change at line 440 skipping to change at line 440
<target/> <target/>
</trans-unit> </trans-unit>
</body> </body>
</file> </file>
</xliff>''' </xliff>'''
xlifffile = xliff.xlifffile.parsestring(xlfsource) xlifffile = xliff.xlifffile.parsestring(xlfsource)
assert xlifffile.units[0].istranslatable() assert xlifffile.units[0].istranslatable()
assert xlifffile.units[0].source == '' assert xlifffile.units[0].source == ''
assert xlifffile.units[1].istranslatable() assert xlifffile.units[1].istranslatable()
assert xlifffile.units[1].source == '&' assert xlifffile.units[1].source == '&'
def test_multiple_filenodes(self):
xlfsource = '''<?xml version="1.0" encoding="utf-8"?>
<xliff version="1.1" xmlns="urn:oasis:names:tc:xliff:document:1.1">
<file original="file0" source-language="en" datatype="plaintext">
<body>
<trans-unit id="hello" approved="yes">
<source>Hello</source>
</trans-unit>
</body>
</file>
<file original="file1" source-language="en" datatype="plaintext">
<body>
<trans-unit id="world" approved="yes">
<source>World</source>
</trans-unit>
</body>
</file>
</xliff>'''
xfile = xliff.xlifffile.parsestring(xlfsource)
assert len(xfile.units) == 2
assert xfile.units[0].getid() == "file0\x04hello"
assert xfile.units[1].getid() == "file1\x04world"
xunit = xliff.xlifffile.UnitClass(source="goodbye")
xunit.setid("file2\x04goodbye")
xfile.addunit(xunit)
assert xfile.units[2].getid() == "file2\x04goodbye"
# if there is no file set it will use the active context
xunit = xliff.xlifffile.UnitClass(source="lastfile")
xunit.setid("lastfile")
xfile.addunit(xunit)
assert xfile.units[3].getid() == "file2\x04lastfile"
newxfile = xliff.xlifffile()
newxfile.addunit(xfile.units[0])
newxfile.addunit(xfile.units[1])
assert newxfile.units[0].getid() == "file0\x04hello"
assert newxfile.units[1].getid() == "file1\x04world"
assert newxfile.getfilenode("file0")
assert newxfile.getfilenode("file1")
assert not newxfile.getfilenode("foo")
 End of changes. 1 change blocks. 
0 lines changed or deleted 0 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)