Translation File Access
Sketch allows to define “decision tables” to map a given ID to a translated text. The REST API allows to query for this file to use its translations somewhere else. GET /connectr/api/translations/{path}
Example Request URL: http://connectr.example.org:8080/connectr/api/translations/Models/Contoso/0-MainDepartment/3-DecisionTables/Amounttype.lgs
Template parameter | Value | Description |
---|---|---|
path (Mandatory) | String | Relative path of the Decision Table file in the ModelStore. Use Sketch’s “Properties” view to find the “location” property, then use everything after the first /modelstore/ part of that field. Example: /ModelStore/Development/0-MainDepartment/3-DecisionTables/Amount type.lgs |
Response status code | Content type | Description |
---|---|---|
200 OK | application/xml | Request completed successfully, translations in response. See appendix “XML Schema for Decision Table Structure”. |
400 Bad request | text/plain | Request specified a file which doesn’t look like a Decision Table. |
404 Not found | text/plain | Requested file could not be found. |
Response example
<sl:selectionList xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:sl="http:///namespace.lettergen.be/letterGen/1.0/selectionList.xsd">
<keyValuePairs>
<keyValuePair>
<key>1</key>
<value>
<translation lang_iso="en-US">one</translation>
<translation lang_iso="fr-FR">un</translation>
</value>
</keyValuePair>
<keyValuePair>
<key>2</key>
<value>
<translation lang_iso="en-US">two</translation>
<translation lang_iso="fr-FR">deux</translation>
</value>
</keyValuePair>
<keyValuePair>
<key>3</key>
<value>
<translation lang_iso="en-US">three</translation>
<translation lang_iso="fr-FR">trois</translation>
</value>
</keyValuePair>
</keyValuePairs>
<description>
<translation lang_iso="en-US">TestDecisionTable</translation>
</description>
</sl:selectionList>