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.