- 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
LanguageManager
- Unless stated otherwise, all objects are available in the following Across versions:
- 5.7
- 6.0
- 6.3
- 7.0
Function-specific return values are listed with each function.
For more information on return values and a complete list of error codes, see Function Return Types.
Function | Description |
Adds a comment to the language of a document. | |
Adds another target language to the specified document. | |
Adds a new language to the system so it can be used as a source or target language. | |
Returns the LCIDs of the countries. | |
The LCIDs of the countries as a semi-colon separated list. | |
Returns the names of the countries. | |
Returns the names of the countries as a semi-colon separated list. | |
Returns the GUIDs of the templates of the finished tasks of a target language of a specific document. | |
Returns the GUIDs of the templates of the finished tasks of a target language of a specific document. | |
Returns a list of the attachments of a language of a specific document. | |
Returns the comments of a language. | |
Returns the due date of a target language of a specific document. | |
Returns the number of paragraphs in the target language of a certain document that have a certain paragraph status (Untouched, Touched, Translated, Checked, etc.). | |
Returns the progress of the translation of the document in a specified language. | |
Returns the number of words in the target language of a certain document that have a certain paragraph status (Untouched, Touched, Translated, Checked, etc.). | |
Gets the names of the languages. | |
Get the names of the languages as a semi-colon separated list. | |
Returns the language primary IDs. | |
Returns the language primary IDs as semi-colon separated list. | |
Returns whether a target language is finished or not. | |
Removes a target language from the specified document. | |
Removes a target language from the specified document. | |
Removes a language from the system. This is only possible if no project uses this language. | |
Sets a target language of a document to finished or unfinished. | |
Sets the state of all paragraphs to a certain value. Optionally, only empty paragraphs can be taken into account. | |
Changes one paragraph state to another for a certain target language in a certain document. |
LanguageManager.AddLanguageComment
Adds a comment to the language of a document.
Parameters
Type | Name | Description | |
1 | string | ST | A security token for use in other crossAPI SI functions. |
2 | string | DocumentGuid | The GUID of the document. |
3 | int | LanguageLcid | The LCID of the language from the document to which the comment should be added. |
4 | string | CommentTitle | The title of the comment. |
5 | string | CommentText | The text of the comment. |
Return Values
Result | Type/Value | Interpretation |
Success | Is always empty. | |
Error | 15 | Language does not exist. |
Error | 16 | Document does not exist. |
Error | 61 | Unable to add comment to language. |
LanguageManager.AddLanguageToDocument
Adds another target language to the specified document.
Parameters
Type | Name | Description | |
1 | string | ST | A security token for use in other crossAPI SI functions. |
2 | string | DocumentGuid | The GUID of the document. |
3 | int | TargetLanguageLcid | The LCID of the target language for which the task should be assigned. |
Return Values
Result | Type/Value | Interpretation |
Success | Is always empty. | |
Error | 15 | Language does not exist. |
Error | 16 | Document does not exist. |
Error | 113 | Language already exists for this document. |
Error | 114 | Cannot add language. |
Error | 116 | The language is involved in crossGrid process and cannot be edited or deleted. |
Error | 180 | The document is not ready because it is being checked in. |
Please note that no pre-translation will be carried out. If a pre-translation is needed, the corresponding methods from the CrossTankManager have to be used.
LanguageManager.AddLanguageToSystem
Adds a new language to the system so it can be used as a source or target language.
Parameters
Type | Name | Description | |
1 | string | ST | A security token for use in other crossAPI SI functions. |
2 | int | Lcid | The primary language identifier of the language that should be added, e.g. 7 for German. For a list of primary language IDs, see LCIDs. |
Return Values
Result | Type/Value | Interpretation |
Success | Is always empty. | |
Error | 15 | Language does not exist. |
Error | 114 | Cannot add language. |
Error | 150 | Language already exists in the system. |
LanguageManager.GetCountriesLCIDs
Returns the LCIDs of the countries.
Parameters
Type | Name | Description | |
1 | string | ST | A security token for use in other crossAPI SI functions. |
2 | int | PrimaryId | An array of language primary IDs. |
Return Values
Result | Type/Value | Interpretation |
Success | string | The LCIDs of the countries as an array. |
Error | 15 | Language does not exist. |
LanguageManager.GetCountriesLCIDsCSV
The LCIDs of the countries as a semi-colon separated list.
Parameters
Type | Name | Description | |
1 | string | ST | A security token for use in other crossAPI SI functions. |
2 | int | PrimaryId | An array of language primary IDs. |
Return Values
Result | Type/Value | Interpretation |
Success | string | The LCIDs of the countries as semicolon-separated list. |
Error | 15 | Language does not exist. |
LanguageManager.GetCountriesNames
Returns the names of the countries.
Parameters
Type | Name | Description | |
1 | string | ST | A security token for use in other crossAPI SI functions. |
2 | int | LCIDs | The LCIDs of the languages. |
Return Values
Result | Type/Value | Interpretation |
Success | string | The names of the countries as an array. |
Error | 15 | Language does not exist. |
LanguageManager.GetCountriesNamesCSV
Returns the names of the countries as a semi-colon separated list.
Parameters
Type | Name | Description | |
1 | string | ST | A security token for use in other crossAPI SI functions. |
2 | int | LCIDs | The LCIDs of the languages. |
Return Values
Result | Type/Value | Interpretation |
Success | string | The names of the countries as semicolon-separated list. |
Error | 15 | Language does not exist. |
LanguageManager.GetFinishedLanguageTasks
Returns the GUIDs of the templates of the finished tasks of a target language of a specific document.
Parameters
Type | Name | Description | |
1 | string | ST | A security token for use in other crossAPI SI functions. |
2 | string | DocumentGuid | The GUID of the document within the context of which the task should be assigned. |
3 | int | TargetLanguageLcid | The LCID of the target language for which the task templates of all finished tasks should be returned. |
Return Values
Result | Type/Value | Interpretation |
Success | string | The GUIDs of the task templates of the finished tasks as an array. |
Error | 15 | Language does not exist. |
Error | 16 | Document does not exist. |
LanguageManager.GetFinishedLanguageTasksCSV
Returns the GUIDs of the templates of the finished tasks of a target language of a specific document.
Parameters
Type | Name | Description | |
1 | string | ST | A security token for use in other crossAPI SI functions. |
2 | string | DocumentGuid | The GUID of the document within the context of which the task should be assigned. |
3 | int | TargetLanguageLcid | The LCID of the target language for which the task templates of all finished tasks should be returned. |
Return Values
Result | Type/Value | Interpretation |
Success | string | The GUIDs of the task templates of the finished tasks as a list of semicolon-separated strings. |
Error | 15 | Language does not exist. |
Error | 16 | Document does not exist. |
LanguageManager.GetLanguageAttachmentList
Returns a list of the attachments of a language of a specific document.
Parameters
Type | Name | Description | |
1 | string | ST | A security token for use in other crossAPI SI functions. |
2 | string | DocumentGuid | The GUID of the document within the context of which the task should be assigned. |
3 | int | LanguageLcid | The LCID of the language for which the attachment list should be returned. |
Return Values
Result | Type/Value | Interpretation |
Success | string | The attachments as an XML structure. See remarks for information on the exact structure. |
Error | 15 | Language does not exist. |
Error | 16 | Document does not exist. |
The returned XML structure has the following layout:
<?xmlversion="1.0"encoding="UTF-16"?><Attachments><AttachmentName="[File-Name]"ID="[DB-ID]"/><AttachmentName="[File-Name]"ID="[DB-ID]"/><AttachmentName="[File-Name]"ID="[DB-ID]"/> ... </Attachments>
To save attachments, please see ObjectManager.SaveAttachment.
LanguageManager.GetLanguageComments
Returns the comments of a language.
Parameters
Type | Name | Description | |
1 | string | ST | A security token for use in other crossAPI SI functions. |
2 | string | DocumentGuid | The GUID of the document within the context of which the task should be assigned. |
3 | int | LanguageLcid | The LCID of the language for which the comments should be retrieved. |
Return Values
Result | Type/Value | Interpretation |
Success | string | The comments as an XML structure. See below for information on the exact structure. |
Error | 15 | Language does not exist. |
Error | 16 | Document does not exist. |
The returned XML structure has the following layout:
<Comments> <Comment Date="[Date]" Time="[Time]" Author="[Author]" Title="[Title]"> [Text] </Comment> <Comment Date="[Date]" Time="[Time]" Author="[Author]" Title="[Title]"> [Text] </Comment> <Comment Date="[Date]" Time="[Time]" Author="[Author]" Title="[Title]"> [Text] </Comment> ... </Comments>
Date and Time are formatted according to the current locale.
LanguageManager.GetLanguageDeadline
Returns the due date of a target language of a specific document.
Parameters
Type | Name | Description | |
1 | string | ST | A security token for use in other crossAPI SI functions. |
2 | string | DocumentGuid | The GUID of the document within the context of which the task should be assigned. |
3 | int | TargetLanguageLcid | The LCID of the target language for which the due date should be returned. |
Return Values
Result | Type/Value | Interpretation |
Success | DateTime | The due date of the specified language. |
Error | 15 | Language does not exist. |
Error | 16 | Document does not exist. |
LanguageManager.GetLanguageParagraphCountByState
Returns the number of paragraphs in the target language of a certain document that have a certain paragraph status (Untouched, Touched, Translated, Checked, etc.).
Parameters
Type | Name | Description | |
1 | string | ST | A security token for use in other crossAPI SI functions. |
2 | string | DocumentGuid | The GUID of the document. |
3 | int | TargetLanguageLcid | The LCID of a target language within the given document from which the number of paragraphs with a certain state should be counted. |
4 | string | StateGuid | The GUID of a paragraph state from which the number of existing paragraphs should be counted. The GUID can be obtained via the GetParagraphStateGuidByName function. |
Return Values
Result | Type/Value | Interpretation |
Success | int | The number of paragraphs with the assigned state in the assigned target language in the assigned document. |
Error | 15 | Language does not exist. |
Error | 16 | Document does not exist. |
Error | 23 | This document format is not supported. Across checks this according to the document extension and not to the content. When a file is checked in or updated, Across first checks whether the document extension is supported and only then if the file is present at the given location. |
Error | 41 | The paragraph state does not exist. |
LanguageManager.GetLanguageProgress
Returns the progress of the translation of the document in a specified language.
Parameters
Type | Name | Description | |
1 | string | ST | A security token for use in other crossAPI SI functions. |
2 | string | DocumentGuid | The GUID of the document. |
3 | int | LanguageLcid | The LCID of the language. |
4 | int | Method | The method to use to calculate the progress.
|
Return Values
Result | Type/Value | Interpretation |
Success | double | The progress of the translation of the document in percent. |
Error | 15 | Language does not exist. |
Error | 16 | Document does not exist. |
Child object-based calculation is the same as atom state-based calculation for languages.
LanguageManager.GetLanguageWordCountByState
Returns the number of words in the target language of a certain document that have a certain paragraph status (Untouched, Touched, Translated, Checked, etc.).
Parameters
Type | Name | Description | |
1 | string | ST | A security token for use in other crossAPI SI functions. |
2 | string | DocumentGuid | The GUID of the document. |
3 | int | TargetLanguageLcid | The LCID of a target language within the given document from which the number of words with a certain state should be counted. |
4 | string | StateGuid | The GUID of a paragraph state from which the number of words should be counted. The GUID can be obtained via the GetParagraphStateGuidByName function. |
Return Values
Result | Type/Value | Interpretation |
Success | int | The number of words with the assigned state in the assigned target language in the assigned document. |
Error | 15 | Language does not exist. |
Error | 16 | Document does not exist. |
Error | 23 | This document format is not supported. Across checks this according to the document extension and not to the content. When a file is checked in or updated, Across first checks whether the document extension is supported and only then if the file is present at the given location. |
Error | 41 | The paragraph state does not exist. |
LanguageManager.GetLanguagesNames
Gets the names of the languages.
Parameters
Type | Name | Description | |
1 | string | ST | A security token for use in other crossAPI SI functions. |
2 | int | PrimaryId | An array of language primary IDs. |
Return Values
Result | Type/Value | Interpretation |
Success | string | Returns the names of the languages as an array. |
Error | 15 | Language does not exist. |
LanguageManager.GetLanguagesNamesCSV
Get the names of the languages as a semi-colon separated list.
Parameters
Type | Name | Description | |
1 | string | ST | A security token for use in other crossAPI SI functions. |
2 | int | PrimaryId | An array of language primary IDs. |
Return Values
Result | Type/Value | Interpretation |
Success | string | Returns the names of the languages as a semicolon-separated list. |
Error | 15 | Language does not exist. |
LanguageManager.GetLanguagesPrimaryIdsCSV
Returns the language primary IDs as semi-colon separated list.
Parameters
Type | Name | Description | |
1 | string | ST | A security token for use in other crossAPI SI functions. |
Return Values
Result | Type/Value | Interpretation |
Success | string | The language primary IDs as semicolon-separated list. |
LanguageManager.IsLanguageFinished
Returns whether a target language is finished or not.
Parameters
Type | Name | Description | |
1 | string | ST | A security token for use in other crossAPI SI functions. |
2 | string | DocumentGuid | The GUID of the document to which the target language belongs. |
3 | int | TargetLanguageLcid | The LCID of the target language. |
Return Values
Result | Type/Value | Interpretation |
Success | bool | True in case the language is finished, false otherwise. |
Error | 15 | Language does not exist. |
Error | 16 | Document does not exist. |
LanguageManager.RemoveLanguageFromDocument
Removes a target language from the specified document.
Parameters
Type | Name | Description | |
1 | string | ST | A security token for use in other crossAPI SI functions. |
2 | string | DocumentGuid | The GUID of the document from which the language should be removed. |
3 | int | TargetLanguageLcid | The LCID of the language that should be removed from the document. |
Return Values
Result | Type/Value | Interpretation |
Success | Is always empty. | |
Error | 15 | Language does not exist. |
Error | 16 | Document does not exist. |
Error | 115 | Cannot remove language. |
Error | 116 | The language is involved in crossGrid process and cannot be edited or deleted. |
Error | 180 | The document is not ready because it is being checked in. |
The language is removed even if there are not yet imported offline packages for it. Please use WanGridManager.GetListOfUnimportedOfflinePackages to check for not yet imported packages prior to removing the language.
LanguageManager.RemoveLanguageFromDocument2
Removes a target language from the specified document.
Parameters
Type | Name | Description | |
1 | string | ST | A security token for use in other crossAPI SI functions. |
2 | string | DocumentGuid | The GUID of the document from which the language should be removed. |
3 | int | TargetLanguageLcid | The LCID of the language that should be removed from the document. |
4 | bool | ForceRemoveUnimportedPackages | Specifies whether to remove the unimported packages or not. |
Return Values
Result | Type/Value | Interpretation |
Success | Is always empty. | |
Error | 15 | Language does not exist. |
Error | 16 | Document does not exist. |
Error | 115 | Cannot remove language. |
Error | 116 | The language is involved in crossGrid process and cannot be edited or deleted. |
Error | 180 | The document is not ready because it is being checked in. |
LanguageManager.RemoveLanguageFromSystem
Removes a language from the system. This is only possible if no project uses this language.
Parameters
Type | Name | Description | |
1 | string | ST | A security token for use in other crossAPI SI functions. |
2 | int | Lcid | The primary language identifier of the language that should be removed, e.g. 7 for German. For a list of primary language IDs, see LCIDs. |
Return Values
Result | Type/Value | Interpretation |
Success | Is always empty. | |
Error | 15 | Language does not exist. |
Error | 115 | Cannot remove language. |
To get the primary language IDs of all languages added in Across, please use LanguageManager.GetLanguagesPrimaryIds or LanguageManager.GetLanguagesPrimaryIdsCSV.
You can also check the LCID table.
The primary ID for a language can also be computed based on the formula for LCIDs: LCID = PrimaryId + 1024 * CountryId
LanguageManager.SetLanguageFinished
Sets a target language of a document to finished or unfinished.
Parameters
Type | Name | Description | |
1 | string | ST | A security token for use in other crossAPI SI functions. |
2 | string | DocumentGuid | The GUID of the document. |
3 | int | LanguageLcid | The LCID of the target language. |
4 | bool | Finished | Specifies whether to set the language to finished or not. |
5 | bool | WithParents | Specifies whether the parent objects will also be considered or not. |
Return Values
Result | Type/Value | Interpretation |
Success | Is always empty. | |
Error | 15 | Language does not exist. |
Error | 16 | Document does not exist. |
Error | 112 | Is not ready to be finished. |
Error | 180 | The document is not ready because it is being checked in. |
Error | 192 | Language cannot be finished. |
Error | 193 | Language cannot be unfinished. |
LanguageManager.SetLanguageParagraphsState
Sets the state of all paragraphs to a certain value. Optionally, only empty paragraphs can be taken into account.
Parameters
Type | Name | Description | |
1 | string | ST | A security token for use in other crossAPI SI functions. |
2 | string | DocumentGuid | The GUID of a document in which the operation should be executed. |
3 | int | TargetLanguageLcid | The LCID of a target language in the given document for which the paragraph state should be set. |
4 | string | StateGuid | The GUID of the paragraph state that should be set. The GUID can be obtained via the GetParagraphStateGuidByName function. |
5 | bool | WithEmptySourceOnly | Only apply to empty paragraphs. |
Return Values
Result | Type/Value | Interpretation |
Success | int | The number of changed paragraphs. |
Error | 15 | Language does not exist. |
Error | 16 | Document does not exist. |
Error | 23 | This document format is not supported. Across checks this according to the document extension and not to the content. When a file is checked in or updated, Across first checks whether the document extension is supported and only then if the file is present at the given location. |
Error | 41 | The paragraph state does not exist. |
Error | 42 | Unable to set paragraph state. More detailed information can be found in the error description. |
Error | 180 | The document is not ready because it is being checked in. |
Error | 225 | The language content cannot be changed. |
The option WithEmptySourceOnly originates from the context of software localization. In these cases, positionable control elements that do not contain text represent empty paragraphs that frequently occur.
The function will fail in case the language is assigned to a crossGrid package, even when the tasks involved in the package are finished.
LanguageManager.SwitchLanguageParagraphState
Changes one paragraph state to another for a certain target language in a certain document.
Parameters
Type | Name | Description | |
1 | string | ST | A security token for use in other crossAPI SI functions. |
2 | string | DocumentGuid | The GUID of a document in which the paragraph states should be replaced. |
3 | int | TargetLanguageLcid | The LCID of a target language in the given document in which the paragraph state should be replaced with a different one. |
4 | string | OriginalStateGuid | The GUID of a paragraph state that should be replaced. The GUID can be obtained via the GetParagraphStateGuidByName function. |
5 | string | TargetStateGuid | The GUID of a paragraph state that should replace the original one. The GUID can be obtained via the GetParagraphStateGuidByName function. |
Return Values
Result | Type/Value | Interpretation |
Success | int | The number of changed paragraphs. |
Error | 15 | Language does not exist. |
Error | 16 | Document does not exist. |
Error | 23 | This document format is not supported. Across checks this according to the document extension and not to the content. When a file is checked in or updated, Across first checks whether the document extension is supported and only then if the file is present at the given location. |
Error | 41 | The paragraph state does not exist. |
Error | 42 | Unable to set paragraph state. More detailed information can be found in the error description. |
Error | 180 | The document is not ready because it is being checked in. |
Error | 225 | The language content cannot be changed. |
The function will fail in case the language is assigned to a crossGrid package, even when the tasks involved in the package are finished.
Please see TaskManager.SwitchTaskParagraphState for a function that can change paragraph states while tasks of the same target language are assigned to a crossGrid package.