crowdin: Don't strip CDATA sections
* We used to remove CDATA sections from translations, which we can
prevent by specifying the XMLParser with an option instead of just
relying on etree.tostring()
Change-Id: Ic1ec407626b42c6a3a306e7e3b3b1eceda1387b3
diff --git a/crowdin_sync.py b/crowdin_sync.py
index 3cb4ec1..a9d848c 100755
--- a/crowdin_sync.py
+++ b/crowdin_sync.py
@@ -137,7 +137,8 @@
XML = XML[XML.find('\n')+1:]
try:
- tree = etree.fromstring(XML)
+ parser = etree.XMLParser(strip_cdata=False)
+ tree = etree.parse(path, parser=parser).getroot()
except etree.XMLSyntaxError as err:
print(f'{path}: XML Error: {err.error_log}')
filename, ext = os.path.splitext(path)