Sample code to save SDLXLIFF to target document

Hi everyone. Could someone please share with me on any sample code to save a SDLXLIFF into a target document?

I could do it in Trados Studio 2015, by opening a SDLXLIFF file (double-clicking on the file) , then File->Save Target As.

How may I do this in C#?

Thanks a million!

Parents Reply
  • Hello both, I have a very similar task, I need to write a C# console application that simply takes as input a .sdlxliff and outputs the native version of this .sdlxliff. Let's assume this input .sdlxliff has segments from English -> Greek and the original/native source file from which this .sdlxliff originated is a Word document in English. Then, the expected output would be, again, a Word document but in Greek, not English.

    I have something like:

            private void ConvertFromXliff(FileBasedProject project, string xliffFilePath)
            {
                project.AddFolderWithFiles(xliffFilePath, recursive: false);

                ProjectFile[] projectFiles = project.GetSourceLanguageFiles();

                AutomaticTask convert = project.RunAutomaticTask(projectFiles.GetIds(), AutomaticTaskTemplateIds.GenerateTargetTranslations);
            }

    This runs, but does not produce the Greek Word file that I am expecting. When using SDL Trados UI, I am throwing an .sdlxliff in the Editor window and then I run batch task and it just works (ONLY IF I DISABLE MY ANTI-VIRUS FIRST). Thanks in advance!

Children
No Data