Class TranslationResult (2.1.0)

public sealed class TranslationResult

The result of a translation operation.

Inheritance

Object > TranslationResult

Namespace

Google.Cloud.Translation.V2

Assembly

Google.Cloud.Translation.V2.dll

Constructors

TranslationResult(String, String, String, String, String, Nullable<TranslationModel>)

public TranslationResult(string originalText, string translatedText, string detectedSourceLanguage, string specifiedSourceLanguage, string targetLanguage, TranslationModel? model)

Constructs an instance.

Parameters
NameDescription
originalTextString

The original text.

translatedTextString

The translated text.

detectedSourceLanguageString

The source language code detected by the server, if any.

specifiedSourceLanguageString

The source language code specified by the API caller.

targetLanguageString

The target language code.

modelNullable<TranslationModel>

The model used to perform the translation, if known.

Remarks

This constructor is for the benefit of testability, in case you wish to provide your own fake implementation of TranslationClient.

TranslationResult(String, String, String, String, String, Nullable<TranslationModel>, String)

public TranslationResult(string originalText, string translatedText, string detectedSourceLanguage, string specifiedSourceLanguage, string targetLanguage, TranslationModel? model, string modelName)

Constructs an instance.

Parameters
NameDescription
originalTextString

The original text.

translatedTextString

The translated text.

detectedSourceLanguageString

The source language code detected by the server, if any.

specifiedSourceLanguageString

The source language code specified by the API caller.

targetLanguageString

The target language code.

modelNullable<TranslationModel>

The model used to perform the translation, if known.

modelNameString

The name of the model used to perform the translation.

Remarks

This constructor is for the benefit of testability, in case you wish to provide your own fake implementation of TranslationClient.

Properties

DetectedSourceLanguage

public string DetectedSourceLanguage { get; }

The source language code detected by the server. This may be null, typically due to the source language being supplied by the caller.

Property Value
TypeDescription
String

Model

public TranslationModel? Model { get; }

The model used to perform the translation, if known and available as one of the values in TranslationModel.

Property Value
TypeDescription
Nullable<TranslationModel>

ModelName

public string ModelName { get; }

The name of the model used to perform the translation. This may be present even if Model is null, if a custom model name has been specified via AdvancedTranslationClient.

Property Value
TypeDescription
String

OriginalText

public string OriginalText { get; }

The original text (or HTML) that was translated.

Property Value
TypeDescription
String

SpecifiedSourceLanguage

public string SpecifiedSourceLanguage { get; }

The source language code supplied by the caller, if any.

Property Value
TypeDescription
String

TargetLanguage

public string TargetLanguage { get; }

The target language code that the text was translated into.

Property Value
TypeDescription
String

TranslatedText

public string TranslatedText { get; }

The translated text.

Property Value
TypeDescription
String