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 |
---|---|
Boolean |
SourceLanguage
Gets the source language.
Declaration
CultureCode SourceLanguage { get; }
Property Value
Type | Description |
---|---|
Culture |
TargetLanguage
Gets the target language.
Declaration
CultureCode TargetLanguage { get; }
Property Value
Type | Description |
---|---|
Culture |
TranslationProvider
The translation provider to which this language direction belongs.
Declaration
ITranslationProvider TranslationProvider { get; }
Property Value
Type | Description |
---|---|
ITranslation |
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 Add
If the provider doesn't support adding/updating, the
implementation should return a reasonable Import
Declaration
ImportResult[] AddOrUpdateTranslationUnits(TranslationUnit[] translationUnits, int[] previousTranslationHashes, ImportSettings settings)
Parameters
Type | Name | Description |
---|---|---|
Translation |
translationUnits | An arrays of translation units to be added. |
Int32[] | previousTranslationHashes | If provided, a corresponding array of a the hash code of a previous translation. |
Import |
settings | The settings used for this operation. |
Returns
Type | Description |
---|---|
Import |
An array of Import |
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 |
---|---|---|
Translation |
translationUnits | An arrays of translation units to be added. |
Int32[] | previousTranslationHashes | Corresponding hash codes of a previous translation (0 if unknown). The parameter may be null. |
Import |
settings | The settings used for this operation. |
Boolean[] | mask | A boolean array with the same cardinality as the TU array, specifying which TUs to add. |
Returns
Type | Description |
---|---|
Import |
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 Import
Declaration
ImportResult AddTranslationUnit(TranslationUnit translationUnit, ImportSettings settings)
Parameters
Type | Name | Description |
---|---|---|
Translation |
translationUnit | The translation unit. |
Import |
settings | The settings used for this operation. |
Returns
Type | Description |
---|---|
Import |
An Import |
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 Import
Declaration
ImportResult[] AddTranslationUnits(TranslationUnit[] translationUnits, ImportSettings settings)
Parameters
Type | Name | Description |
---|---|---|
Translation |
translationUnits | An arrays of translation units to be added. |
Import |
settings | The settings used for this operation. |
Returns
Type | Description |
---|---|
Import |
An array of Import |
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 |
---|---|---|
Translation |
translationUnits | An arrays of translation units to be added. |
Import |
settings | The settings used for this operation. |
Boolean[] | mask | A boolean array with the same cardinality as the TU array, specifying which TUs to add. |
Returns
Type | Description |
---|---|
Import |
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 |
---|---|---|
Search |
settings | The settings that define the search parameters. |
Segment | segment | The segment to search for. |
Returns
Type | Description |
---|---|
Search |
A Search |
SearchSegments(SearchSettings, Segment[])
Performs a search for an array of segments.
Declaration
SearchResults[] SearchSegments(SearchSettings settings, Segment[] segments)
Parameters
Type | Name | Description |
---|---|---|
Search |
settings | The settings that define the search parameters. |
Segment[] | segments | The array containing the segments to search for. |
Returns
Type | Description |
---|---|
Search |
An array of Search |
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 Searchtrue
).
Declaration
SearchResults[] SearchSegmentsMasked(SearchSettings settings, Segment[] segments, bool[] mask)
Parameters
Type | Name | Description |
---|---|---|
Search |
settings | The settings that define the search parameters. |
Segment[] | segments | The array containing the segments to search for. |
Boolean[] | mask | The array containing the segments to search for. |
Returns
Type | Description |
---|---|
Search |
An array of Search |
SearchText(SearchSettings, String)
Performs a text search.
Declaration
SearchResults SearchText(SearchSettings settings, string segment)
Parameters
Type | Name | Description |
---|---|---|
Search |
settings | The settings that define the search parameters. |
String | segment | The text to search for. |
Returns
Type | Description |
---|---|
Search |
A Search |
SearchTranslationUnit(SearchSettings, TranslationUnit)
Performs a translation unit search.
Declaration
SearchResults SearchTranslationUnit(SearchSettings settings, TranslationUnit translationUnit)
Parameters
Type | Name | Description |
---|---|---|
Search |
settings | The settings that define the search parameters. |
Translation |
translationUnit | The translation unit to search for. |
Returns
Type | Description |
---|---|
Search |
A Search |
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 |
---|---|---|
Search |
settings | The settings that define the search parameters. |
Translation |
translationUnits | The array containing the translation units to search for. |
Returns
Type | Description |
---|---|
Search |
An array of Search |
SearchTranslationUnitsMasked(SearchSettings, TranslationUnit[], Boolean[])
Similar to Search
Declaration
SearchResults[] SearchTranslationUnitsMasked(SearchSettings settings, TranslationUnit[] translationUnits, bool[] mask)
Parameters
Type | Name | Description |
---|---|---|
Search |
settings | The settings that define the search parameters. |
Translation |
translationUnits | The array containing the translation units to search for. |
Boolean[] | mask | A |
Returns
Type | Description |
---|---|
Search |
An array of Search |
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 |
---|---|---|
Translation |
translationUnit | The translation unit to be updated. |
Returns
Type | Description |
---|---|
Import |
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 |
---|---|---|
Translation |
translationUnits | The translation unit array to be updated. |
Returns
Type | Description |
---|---|
Import |
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. |