How do I create new WPML xliff files that contain source text only?

Dear colleagues,

Does anyone who is familiar with WordPress know how to create xliff files with only source text out of xliff files that contain both source and target text?

Some of the WPML xliff files the client sent have translated segments on the target side and I am trying to clear them so that I can apply my custom xml filetype to these files.  I tried "saving source as" on these files, thinking this would make the newly created xliff files source text only files, but it didn't work.  Are there other methods I can try?

Thank you.

Chunyi

 

  • Hi ,

    Probably the easiest way is to open the file in Studio using the standard XLIFF file type and copy source to target. Save the target file and now you have the XLIFF with source and target populated, both contain the source text so you can use your new XML file type to handle them. Make sure you disable the option to store segmentation information in the target file first or you’ll have additional information in the file you don’t want. (Can’t recall the exact name of this as I’m travelling without access to Studio at the moment)

    Alternatively you could remove the target and create a copy of the source in the XLIFF using regex in Notepad++.

    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

  • Hi Paul,

    When you say "open the file in Studio using the standard XLIFF file type", do you mean to move the XLIFF 1.1 or XLIFF 2.0 file type all the way to the top, or can these file types stay where they are in File>Options>File Types?
    Also, could you tell me how to use regex in Notepad++ to remove the target and create a copy of the source in the XLIFF in case I have trouble executing the first method?
    Thank you so much for your help!

    Chunyi
  • Hi Paul,

    I tried your method #1 by copying source to target and save target to have supposedly source only xliff file.
    Then I opened this xliff file using the new xml file type, and the file was completely empty, with neither source nor target segments.
    I also tried save source as, which resulted a xliff file with identical translated segments in both source and target sides.
    With the above trials I did not disable the option to store segmentation information in the target file, because I did not know where to find it. Not sure if this caused my failure.

    If you could tell me the steps to remove the target and create source text only xliffs using regex in Notepad++, I will forever in gratitude:))

    Thank you again!!

    Chunyi
  • Hi Paul,

    I tried the save target as method you mentioned with a different tool and finally got a source-only xliff that I can use the xml filetype with to process these problem xliff files (the ones with translation in target). So I no longer need the advice to create the source file in Notepad++ using regex.
    Thank you so much for all of your help and great advice. I couldn't have done this without your help!
    Have a great weekend!

    Chunyi
  • Hi ,

    The option is here:

    File -> Options -> Filetypes -> XLIFF -> Settings -> Do not store segmentation information in the translated file

    Your failure was exactly due to this because it causes the content to be placed into the <mrk> element instead of the <target>, so you obviously find nothing. But glad you found a solution with another tool.

    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

  • Hi Paul,

    You were right. After checking the box for " Do not store segmentation information in the translated file" in xliff filetype, I got the same source only file create by another tool. Thank you for the advice!
    I just have one last question: is it fine from now on to leave this option checked (it's off by default)? Would that create a problem for my partner who uses the default setting or the client who will receive translated files without segmentation information? If so, then I would need to turn off this option after preparing the files.
    Thank you again.

    Chunyi