language weaver cloud pre lookup/find and replace

Dear CS team,

I am using language weaver cloud in Studio 2024 professional. I have the SOZLUK.sdltb term base file. I want to use sdltb file in "Pre Lookup Find / Replace" in language weaver cloud. As far as I researched, I found that this file needs to be converted to xml.

I converted sdtb to xml or tbx via gloassary converter or export from multiterm. Every time I upload the file to Pre Lookup Find / Replace I got an error message. I searched the forum and found the following information. The xml file should have the following structure. But I can't find a way to convert sdltb to the proper xmll format.

How can I convert .sdltb (term-based file) file to appropirate xml formatt to use in Pre Lookup Find / Replace.

Thank you for your help.

 RE: Microsoft Translator Provider - Pre/Post Lookup - "Proper" XML Format 

<EditCollection>
<Items>
<EditItem Enabled={enabled value} EditItemType={type (plain text or regular expression)}>
<FindText>{text to find}</FindText>
<ReplaceText>{replacement text}</ReplaceText>
</EditItem>
...
</Items>
</EditCollection>

Language Weaver Cloud settings page with options for 'Include tags in translations', 'Re-translation of unconfirmed segments', 'Feedback for Language Weaver translations', and 'Pre-Lookup FindReplace' with a browse button.Error message in a pop-up window with the title 'XML Serialization Error' and a description mentioning 'System.Xml.Serialization.XmlSerializer.Deserialize' with a 'Save report' and 'Close' button.



Generated Image Alt-Text
[edited by: RWS Community AI at 3:30 PM (GMT 1) on 7 Apr 2025]
emoji
Parents
  •  

    There are many ways to tackle this using Python, Powershell, VB Scripts for example.  But a simple way that probably works for you is to simply use Excel and build up the structure with formulae.  I have attached a zip containing the Excel and also the xml created from it so you have a working example.  I didn't test the import but the structure looks correct.  Here's the zip.

    example.zip

    Here's the process:

    My Excel (which I could get from the Glossary Converter for example) contains two columns, A (Source terms) and B (target terms).  I now add the following formulae into cells C to G in row #2.

    C:
    ="<EditItem Enabled=""true"" EditItemType=""plain_text"">"

    D:
    ="  <FindText>" & SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(A2,"&","&amp;"),"<","&lt;"),">","&gt;"),"""","&quot;"),"'","&apos;") & "</FindText>"

    E:
    ="  <ReplaceText>" & SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(B2,"&","&amp;"),"<","&lt;"),">","&gt;"),"""","&quot;"),"'","&apos;") & "</ReplaceText>"

    F:
    ="</EditItem>"

    G:
    =C2 & CHAR(10) & D2 & CHAR(10) & E2 & CHAR(10) & F2

    Now copy all cells down so you have a completed spreadsheet for every term in your list.

    Finally, put this into cell G1:
    ="<?xml version=""1.0"" encoding=""UTF-8""?>" & CHAR(10) & "<EditCollection>" & CHAR(10) & "  <Items>"

    And this into the last cell after all the fomulae.  In my example it was G22:
    ="  </Items>" & CHAR(10) & "</EditCollection>"

    Now you have something like this:

    Excel spreadsheet with two columns labeled 'English A' and 'Romanian B' filled with terms, and columns C to G containing XML code generated by formulas.

    Next copy all the populated cells in column G and paste into a text file called yourimportfile.xml so it looks something like this:

    Close-up of an XML structure in a text editor with highlighted syntax, showing a correctly structured XML tag for 'EditItem' with nested 'FindText' and 'ReplaceText' elements.

    Paul Filkin | RWS Group

    ________________________
    Design your own training!

    You've done the courses and still need to go a little further, or still not clear? 
    Tell us what you need in our Community Solutions Hub

    emoji


    Generated Image Alt-Text
    [edited by: RWS Community AI at 7:31 PM (GMT 1) on 21 Apr 2025]
Reply
  •  

    There are many ways to tackle this using Python, Powershell, VB Scripts for example.  But a simple way that probably works for you is to simply use Excel and build up the structure with formulae.  I have attached a zip containing the Excel and also the xml created from it so you have a working example.  I didn't test the import but the structure looks correct.  Here's the zip.

    example.zip

    Here's the process:

    My Excel (which I could get from the Glossary Converter for example) contains two columns, A (Source terms) and B (target terms).  I now add the following formulae into cells C to G in row #2.

    C:
    ="<EditItem Enabled=""true"" EditItemType=""plain_text"">"

    D:
    ="  <FindText>" & SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(A2,"&","&amp;"),"<","&lt;"),">","&gt;"),"""","&quot;"),"'","&apos;") & "</FindText>"

    E:
    ="  <ReplaceText>" & SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(B2,"&","&amp;"),"<","&lt;"),">","&gt;"),"""","&quot;"),"'","&apos;") & "</ReplaceText>"

    F:
    ="</EditItem>"

    G:
    =C2 & CHAR(10) & D2 & CHAR(10) & E2 & CHAR(10) & F2

    Now copy all cells down so you have a completed spreadsheet for every term in your list.

    Finally, put this into cell G1:
    ="<?xml version=""1.0"" encoding=""UTF-8""?>" & CHAR(10) & "<EditCollection>" & CHAR(10) & "  <Items>"

    And this into the last cell after all the fomulae.  In my example it was G22:
    ="  </Items>" & CHAR(10) & "</EditCollection>"

    Now you have something like this:

    Excel spreadsheet with two columns labeled 'English A' and 'Romanian B' filled with terms, and columns C to G containing XML code generated by formulas.

    Next copy all the populated cells in column G and paste into a text file called yourimportfile.xml so it looks something like this:

    Close-up of an XML structure in a text editor with highlighted syntax, showing a correctly structured XML tag for 'EditItem' with nested 'FindText' and 'ReplaceText' elements.

    Paul Filkin | RWS Group

    ________________________
    Design your own training!

    You've done the courses and still need to go a little further, or still not clear? 
    Tell us what you need in our Community Solutions Hub

    emoji


    Generated Image Alt-Text
    [edited by: RWS Community AI at 7:31 PM (GMT 1) on 21 Apr 2025]
Children
No Data