Google Cloud Translation v2 API - Class TranslationResult (3.3.0)

public sealed class TranslationResult

Reference documentation and code samples for the Google Cloud Translation v2 API 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, 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.

modelTranslationModel

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, 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.

modelTranslationModel

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
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