Thursday, 19 May 2011

XML files - Proof the root tags when turning ini files into sdlfiletype

When creating new XML file types from existing ini files, for example those you used in TagEditor, you may have some difficulties to create a project in which your files will be recognized as translatable with the brand new file types. Create a new file type with Studio is not so complicated if you have an ini file, but there is one "bug" in the conversion you should be aware of: only one root element will be imported in this wizard...


I already mentionned in a former post that the file type button in the "create project" wizard doesn't work. So create your new file types in a template or in your own options (Tools -> Options...).

Here a short description how to create a new XML file type:



You can create a file type with New...





Here, you choose "XML".



 

Then you give at least a name to your file type.



 

 Here you enter your ini file with "Browse"



You get then something like this.



 Here you can change the tag properties.




AND HERE WE ARE...



In this window, the conversion from ini to sdlxliff doesn't work exactly. If you have only one root listed in the ini file, you won't get any problem, but if your ini file is to be used with many different xml files, that is, with many different roots, only one root will be imported in this wizard.

This means that not all your files you could convert in TagEditor will be convertible in Studio.
You have to adjust the settings manually by adding the missing root elements yourself:





To know how many roots are set in your ini file, you can check in Tag Editor or in the ini file itself.
Open it in Notepad, search for DOCTYPE and you will get something like this
 DOCTYPE=root1 root2 root3
 (The different roots ar separated by spaces)


In my example I have
DOCTYPE=martif mtf
-> 2 roots, "martif" and "mtf"


After this adjustment, you can save your new file type and try to create a new project with it.


See also this post if you have no ini but a dtd file to create a file type.

3 comments:

  1. I have a problem with my File type Wizard. When I go to Tools>Options and I click New,I normally get three options: XMl, Simple Delimited Text and Regular Expression Delimited Text. The problem is that I don't get the option XML. Do you have any idea how I can solve this?

    ReplyDelete
    Replies
    1. No, I don't know and I haven't found anything. The file "XML_Template.sdlfiletype" is used to create the XML new file type. I would first check if this file is still in C:\Program Files\SDL\SDL Trados Studio\Studio1\File Types. If not, you'll certainly find it in projects from your customer. Copy it in the given path. It also could be necessarily to reset the Options. Do you (or did you) receive any error message?

      Delete
    2. Thank you very much. I already tried to do that but I got the message: The file type cannot be added, another file type with the ID "Plain text v 1.0.0.0 already exists. I copied the template to my documents and then added it and now it's on the screen again. Thank you very much. The blog is very usefull so keep up the good work.

      Delete