How to retrieve specific strings from .tmx(Translation Memory eXchange) files



Now, I'm trying to find out how to get translated memory from tmx files.


So far, at least I understand that XmlDocument class can be used to explore tmx files since tmx is based on XML.


Here is an example of a tmx file I'm working with.



<tu tuid="1">
<tuv xml:lang="en-US">
<seg>Memory</seg>
</tuv>
<tuv xml:lang="ar">
<seg>XXXXX</seg>
</tuv>
</tu>


What I'm trying to do is...




  1. Read another file (e.g. resx file) and get strings from its element. (I know how to do this)




  2. Explore tmx files like above ones and find whether there is the same string as the one found in another file (in this case, a resx file).




  3. If there is the same string in the tmx file, get the corresponding string (i.e. translated string) from the tmx. (In the above example, if there is a string "Memory" inside the resx file and the tmx file, I need to get the string "XXXXX" from the tmx)




No comments:

Post a Comment