- General Information
- Connecting Third-party Systems
- crossConnect for content systems
- crossConnect for External Editing
- Purpose and usage
- Requirements
- Implementation
- Across XLIFF format
- Across-specific Extensions
- <xliff> Element Attributes
- <file> Element Extensions
- <trans-unit> Element Extension
- Paragraph States
- Paragraph State Flags
- <source> and <target> Element Content
- <bpt> Element Attributes
- <ph> Element Attributes
- <x> Element Attributes
- Across-specific Properties
- Analysis Results
- Sample Files
- Across XLIFF - import, export and segmentation
- Context information
- Exporting best matches in Across XLIFF
- Hyperlinks to XLIFF
- Secure file handling with C#
- Secure file handling with JAVA
- Workflow and vendor configuration
- Sample code - Integrated solution
- Across XLIFF format
- Generic File Connector
- Display Texts
- APIs
- APIs - Technology
- crossTank API v1
- crossTank API v2
- crossTerm API v1
- crossTerm API v2
- crossAPI SI
- Requirements
- Function Return Types
- crossAPI SI and Java
- List of Objects in crossAPI SI
- Sample - transferring checkout files via FileManager
- Sample - VBS
- Text Preprocessing API
Creating Translations
Translations can be created via the API and will be stored directly in crossTank.
Translation creation requests require a crossTank API read/write license. If you do not have one, please contact our Sales team or your responsible contact person at Across for more information.
Translations are entered as lists, meaning that multiple translations can be entered at once. A minimal request for creating a translation contains a Source and a Target segment, each with Text and Language properties, as well as a Creator, Modificator (GUIDs of users), CreationDate, ModificationDate, State and ServerContextGuid.
The Across Identity Server grants the application an access token. Each request to the API has to have this token in the header.
Please note that the examples below omit the headers to stay compact.
Example: Creating a Single Translation
The following example creates a single translation. Besides the required properties, it also defines some formatting ranges. Note that the StyleIds used in the source segment match with those of the target segment. That way, auto-adjustment can properly adjust these formattings when the translation is inserted into a real document. Within the source and target segments, the StyleIds have to be unique.
More information about specifying formatting and elements can be found under crossTank API v2 - Overview.
http://localhost/across/crosstank/api/v2/Translations/createTranslations
[ {"Source": { "Text": "This is the first sentence.", "Language": 1033, "FormatRanges": [ { "Begin": 0, "End": 4, "FontStyle": { "StyleId": 0, "Bold": true } }, { "Begin": 12, "End": 17, "FontStyle": { "StyleId": 1, "Bold": true, "Italic": true } }, { "Begin": 18, "End": 27, "FontStyle": { "StyleId": 2, "Bold": true } } ], "BaseFontStyle": { "StyleId": 2, "FontSize": 12 } }, "Target": { "Text": "Dies ist der erste Satz.", "Language": 1031, "FormatRanges": [ { "Begin": 0, "End": 4, "FontStyle": { "StyleId": 0, "Bold": true } }, { "Begin": 13, "End": 18, "FontStyle": { "StyleId": 1, "Bold": true, "Italic": true } }, { "Begin": 19, "End": 23, "FontStyle": { "StyleId": 2, "Bold": true } } ], "BaseFontStyle": { "StyleId": 2, "FontSize": 12 } }, "Creator" : "870723f0-09c4-4f4e-a8cd-5b39ea9914c5", "Modificator" : "870723f0-09c4-4f4e-a8cd-5b39ea9914c5", "CreationTime": "2019-11-13T00:00:00.000Z", "ModificationTime": "2019-11-13T00:00:00.000Z", "State": 0, "ServerContextGuid" : "b9cbca9f-b250-4d3a-910f-992fc8a89a57" } ]
The response to the creation functions show a list of IDs and the status of the operation for each translation. OperationStatus 1 means that a new translation was created.
Response
[ { "Id": 0, "OperationStatus": 1 } ]
Example: Translation Preset
The storing settings used by crossTank can be defined and reused via the API in a translation preset.
The following request creates a translation preset that overwrites only unreleased translations from the local server context and skips all others. While overwriting, it merges system attributes of the existing translation with those of the new translation. The request will return the GUID of the created translation preset which can then be passed to the function /api/v2/Translations/createTranslationsWithPreset or be used to delete the preset.
http://localhost/across/crosstank/api/v2/Translations/createTranslationPreset
{ "PresetExpirationInMinutes": 0, "PreventMultipleTranslation": true, "IsStoreSpecialChars": true, "IsForceCheckLLSStyleAndPositions": true, "PreventMultiTranslationMode": 2, "FieldProcessingMode": 0, "AttributeUpdateMode": 1 }