RESX
Straker Translations uses a simple .Resx XML structured source file which makes it as easy as possible to send content from your third party systems to us. The XML file can be structured VERY simply with the following nodes.
<root> <data name=""> </root>
HTML In XML
If you are sending content as HTML, such as for a web page, you will need to put it inside CDATA, for example:
<value> <![CDATA[<p>This is an example of some text in HTML with heading 1 to translate</p>]]> </value>
This will retain the HTML content when it is rendered in a workbench for translation and will not be lost in the data transfer.
That is all that is required when creating your structure. Rather than sending a single job for each string, you can combine each string into the data nodes. Once created, the XML file can be passed to us in one of two ways; as a source_file via translate/file method to the API URL or as the payload via translate/text (i.e. the content of what would be a file would be inserted into the Payload field of the API). Whichever method you choose, you will get back a file path inside a JSON structure, with the file returned as XML.
Example
The following example XML will show you the structure of sending data to us for translation. The returned translation is exactly the same, except it will display the translation in each of the value fields.
<?xml version="1.0" encoding="utf-8"?> <root> <data name="unique_identifier"> <value>Welcome to the Straker Translations API</value> </data> <data name="a_different_identifier"> <value>Connecting to the straker translation system is easy</value> </data> <data name="must_be_unique"> <value>Remember to do all testing in the sandbox first</value> </data> </root>
Unformatted XML Returns
It is possible that the returned XML exported from the system may have line breaks removed, however it will still be valid XML. If in doubt you can use a tool to reformat the XML to check. One such online tool can be found at: http://xmltoolbox.appspot.com/
Comments
0 comments
Article is closed for comments.