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
CanReverseLanguageDirection
Gets a flag which indicates whether the translation provider supports searches in the reversed language direction.
Declaration
bool CanReverseLanguageDirection { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
SourceLanguage
Gets the source language.
Declaration
CultureInfo SourceLanguage { get; }
Property Value
Type | Description |
---|---|
System.Globalization.CultureInfo |
TargetLanguage
Gets the target language.
Declaration
CultureInfo TargetLanguage { get; }
Property Value
Type | Description |
---|---|
System.Globalization.CultureInfo |
TranslationProvider
The translation provider to which this language direction belongs.
Declaration
ITranslationProvider TranslationProvider { get; }
Property Value
Type | Description |
---|---|
ITranslationProvider |
Methods
AddOrUpdateTranslationUnits(TranslationUnit[], Int32[], ImportSettings)
Adds an array of translation units to the database. If hash codes of the previous translations are provided,
a found translation will be overwritten. If none is found, or the hash is 0 or the collection is null
,
the operation behaves identical to AddTranslationUnits(TranslationUnit[], ImportSettings).
If the provider doesn't support adding/updating, the implementation should return a reasonable ImportResult but should not throw an exception.
Declaration
ImportResult[] AddOrUpdateTranslationUnits(TranslationUnit[] translationUnits, int[] previousTranslationHashes, ImportSettings settings)
Parameters
Type | Name | Description |
---|---|---|
TranslationUnit[] | translationUnits | An arrays of translation units to be added. |
System.Int32[] | previousTranslationHashes | If provided, a corresponding array of a the hash code of a previous translation. |
ImportSettings | settings | The settings used for this operation. |
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. |
AddOrUpdateTranslationUnitsMasked(TranslationUnit[], Int32[], ImportSettings, Boolean[])
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. |
System.Int32[] | previousTranslationHashes | Corresponding hash codes of a previous translation (0 if unknown). The parameter may be null. |
ImportSettings | settings | The settings used for this operation. |
System.Boolean[] | 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. |
AddTranslationUnit(TranslationUnit, ImportSettings)
Adds a translation unit to the database. If the provider doesn't support adding/updating, the implementation should return a reasonable ImportResult but should not throw an exception.
Declaration
ImportResult AddTranslationUnit(TranslationUnit translationUnit, ImportSettings settings)
Parameters
Type | Name | Description |
---|---|---|
TranslationUnit | translationUnit | The translation unit. |
ImportSettings | settings | The settings used for this operation. |
Returns
Type | Description |
---|---|
ImportResult | An ImportResult which represents the status of the operation (succeeded, ignored, etc). |
AddTranslationUnits(TranslationUnit[], ImportSettings)
Adds an array of translation units to the database. If the provider doesn't support adding/updating, the implementation should return a reasonable ImportResult but should not throw an exception.
Declaration
ImportResult[] AddTranslationUnits(TranslationUnit[] translationUnits, ImportSettings settings)
Parameters
Type | Name | Description |
---|---|---|
TranslationUnit[] | translationUnits | An arrays of translation units to be added. |
ImportSettings | settings | The settings used for this operation. |
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, Boolean[])
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. |
System.Boolean[] | 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. |
SearchSegments(SearchSettings, Segment[])
Performs a search for an array of segments.
Declaration
SearchResults[] SearchSegments(SearchSettings settings, Segment[] segments)
Parameters
Type | Name | Description |
---|---|---|
SearchSettings | settings | The settings that define the search parameters. |
Segment[] | segments | 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. |
SearchSegmentsMasked(SearchSettings, Segment[], Boolean[])
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
behaves identically to SearchSegments(SearchSettings, Segment[]). 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. |
System.Boolean[] | 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. |
System.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. |
SearchTranslationUnit(SearchSettings, TranslationUnit)
Performs a translation unit search.
Declaration
SearchResults SearchTranslationUnit(SearchSettings settings, TranslationUnit translationUnit)
Parameters
Type | Name | Description |
---|---|---|
SearchSettings | settings | The settings that define the search parameters. |
TranslationUnit | translationUnit | The translation unit to search for. |
Returns
Type | Description |
---|---|
SearchResults | A SearchResults object containing the results or an empty object if no results were found. |
SearchTranslationUnits(SearchSettings, TranslationUnit[])
Performs a translation unit search for an array of translation units.
Declaration
SearchResults[] SearchTranslationUnits(SearchSettings settings, TranslationUnit[] translationUnits)
Parameters
Type | Name | Description |
---|---|---|
SearchSettings | settings | The settings that define the search parameters. |
TranslationUnit[] | translationUnits | The array containing the translation units to search for. |
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. |
SearchTranslationUnitsMasked(SearchSettings, TranslationUnit[], Boolean[])
Similar to SearchTranslationUnits(SearchSettings, TranslationUnit[]), but 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. |
System.Boolean[] | 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. |
UpdateTranslationUnit(TranslationUnit)
Updates the properties and fields of an existing translation unit if the source and target segments are unchanged or adds a new translation unit otherwise. If the provider doesn't support adding/updating, the implementation should return a reasonable ImportResult but should not throw an exception.
The translation unit should be initialized in a previous call to the translation memory, so that the ID property is set to a valid value.
Declaration
ImportResult UpdateTranslationUnit(TranslationUnit translationUnit)
Parameters
Type | Name | Description |
---|---|---|
TranslationUnit | translationUnit | The translation unit to be updated. |
Returns
Type | Description |
---|---|
ImportResult | The result of the operation. |
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. |