Interface ITranslationProviderLanguageDirection
Exposes translation provider functionality for a specific language direction.
Namespace: Sdl.LanguagePlatform.TranslationMemoryApi
Assembly: Sdl.LanguagePlatform.TranslationMemoryApi.dll
Syntax
public interface ITranslationProviderLanguageDirection
Properties
SourceLanguage
Gets the source language.
Declaration
CultureCode SourceLanguage { get; }
Property Value
| Type | Description |
|---|---|
| CultureCode |
TargetLanguage
Gets the target language.
Declaration
CultureCode TargetLanguage { get; }
Property Value
| Type | Description |
|---|---|
| CultureCode |
TranslationProvider
The translation provider to which this language direction belongs.
Declaration
ITranslationProvider TranslationProvider { get; }
Property Value
| Type | Description |
|---|---|
| ITranslationProvider |
Methods
AddOrUpdateTranslationUnitsMasked(TranslationUnit[], int[], ImportSettings, bool[])
Adds an array of translation units to the database, but will only add those for which the corresponding mask field is true. If the previous translation hashes are provided, existing translations will be updated if the target segment hash changed.
If the provider doesn't support adding/updating, the implementation should return a reasonable ImportResult but should not throw an exception.
Declaration
ImportResult[] AddOrUpdateTranslationUnitsMasked(TranslationUnit[] translationUnits, int[] previousTranslationHashes, ImportSettings settings, bool[] mask)
Parameters
| Type | Name | Description |
|---|---|---|
| TranslationUnit[] | translationUnits | An arrays of translation units to be added. |
| int[] | previousTranslationHashes | Corresponding hash codes of a previous translation (0 if unknown). The parameter may be null. |
| ImportSettings | settings | The settings used for this operation. |
| bool[] | mask | A boolean array with the same cardinality as the TU array, specifying which TUs to add. |
Returns
| Type | Description |
|---|---|
| ImportResult[] | An array of ImportResult objects, which mirrors the translation unit array. It has the exact same size and contains the status of each add operation for each particular translation unit with the same index within the array. |
AddTranslationUnitsMasked(TranslationUnit[], ImportSettings, bool[])
Adds an array of translation units to the database, but will only add those
for which the corresponding mask field is true. If the provider doesn't support adding/updating, the
implementation should return a reasonable ImportResult but should not throw an exception.
Declaration
ImportResult[] AddTranslationUnitsMasked(TranslationUnit[] translationUnits, ImportSettings settings, bool[] mask)
Parameters
| Type | Name | Description |
|---|---|---|
| TranslationUnit[] | translationUnits | An arrays of translation units to be added. |
| ImportSettings | settings | The settings used for this operation. |
| bool[] | mask | A boolean array with the same cardinality as the TU array, specifying which TUs to add. |
Returns
| Type | Description |
|---|---|
| ImportResult[] | An array of ImportResult objects, which mirrors the translation unit array. It has the exact same size and contains the status of each add operation for each particular translation unit with the same index within the array. |
SearchSegment(SearchSettings, Segment)
Performs a segment search.
Declaration
SearchResults SearchSegment(SearchSettings settings, Segment segment)
Parameters
| Type | Name | Description |
|---|---|---|
| SearchSettings | settings | The settings that define the search parameters. |
| Segment | segment | The segment to search for. |
Returns
| Type | Description |
|---|---|
| SearchResults | A SearchResults object containing the results or an empty object if no results were found. |
SearchSegmentsMasked(SearchSettings, Segment[], bool[])
Performs a search for an array of segments, specifying a mask which specifies which segments should actually be
searched (only those for which the corresponding mask bit is true are searched). If the mask is null, the method
will search all the segments. Passing a mask only makes sense in document search contexts (IsDocumentSearch
set to true).
Declaration
SearchResults[] SearchSegmentsMasked(SearchSettings settings, Segment[] segments, bool[] mask)
Parameters
| Type | Name | Description |
|---|---|---|
| SearchSettings | settings | The settings that define the search parameters. |
| Segment[] | segments | The array containing the segments to search for. |
| bool[] | mask | The array containing the segments to search for. |
Returns
| Type | Description |
|---|---|
| SearchResults[] | An array of SearchResults objects, which mirrors the segments array. It has the exact same size and contains the search results for each segment with the same index within the segments array. |
SearchText(SearchSettings, string)
Performs a text search.
Declaration
SearchResults SearchText(SearchSettings settings, string segment)
Parameters
| Type | Name | Description |
|---|---|---|
| SearchSettings | settings | The settings that define the search parameters. |
| string | segment | The text to search for. |
Returns
| Type | Description |
|---|---|
| SearchResults | A SearchResults object containing the results or an empty object if no results were found. |
SearchTranslationUnitsMasked(SearchSettings, TranslationUnit[], bool[])
Performs a translation unit search for an array of translation units, allows passing a mask which specifies which TUs are actually searched. This is useful in document search contexts where some TUs are passed which should be used to establish a (text) context, but which should not be processed.
Declaration
SearchResults[] SearchTranslationUnitsMasked(SearchSettings settings, TranslationUnit[] translationUnits, bool[] mask)
Parameters
| Type | Name | Description |
|---|---|---|
| SearchSettings | settings | The settings that define the search parameters. |
| TranslationUnit[] | translationUnits | The array containing the translation units to search for. |
| bool[] | mask | A |
Returns
| Type | Description |
|---|---|
| SearchResults[] | An array of SearchResults objects, which mirrors the translation unit array. It has the exact same size and contains the search results for each translation unit with the same index within the translation unit array. |
UpdateTranslationUnits(TranslationUnit[])
Updates the properties and fields of an array of existing translation units if the source and target segments are unchanged or adds new translation units otherwise. If the provider doesn't support adding/updating, the implementation should return a reasonable ImportResult but should not throw an exception.
The translation units should be initialized in previous calls to the translation memory, so that their ID properties are set to valid values.
Declaration
ImportResult[] UpdateTranslationUnits(TranslationUnit[] translationUnits)
Parameters
| Type | Name | Description |
|---|---|---|
| TranslationUnit[] | translationUnits | The translation unit array to be updated. |
Returns
| Type | Description |
|---|---|
| ImportResult[] | An array of results which mirrors the translation unit array. It has the exact same size and contains the results for each translation unit with the same index within the translation unit array. |