I am translating Xliff file using BeautifulSoup and googletrans packages. I managed to extract all strings and translate them and managed to replace strings by creating new tag with a translations, e.g.
<trans-unit id="100890::53706_004">
<source>Continue in store</source>
<target>Kontynuuj w sklepie</target>
</trans-unit>
The problem appears when the source tag has other tags inside.
e.g.
<source><x ctype="x-htmltag" equiv-text="<b>" id="html_tag_191"/>Choose your product\
<x ctype="x-htmltag" equiv-text="</b>" id="html_tag_192"/>From a list: </source>
There are different numbers of these tags and different order of where string appears. E.g. <source> text1 <x /> <x/> text2 <x/> text3 </source>. Each x tag is unique with different id and attributes.
Is there a way to modify the text inside the tag without having to create a new tag? I was thinking I could extract x tags and its attributes but the order or string and x tag in different code lines differs a lot I'm not sure how to do that. Maybe there is other package better suited for translating xliff files?