public sealed class TranslateTextRequest : IMessage<TranslateTextRequest>, IEquatable<TranslateTextRequest>, IDeepCloneable<TranslateTextRequest>, IBufferMessage, IMessage
Reference documentation and code samples for the Google Cloud Translation v3 API class TranslateTextRequest.
Required. The content of the input in string format.
We recommend the total content be less than 30,000 codepoints. The max
length of this field is 1024. Use BatchTranslateText for larger text.
public TranslateTextGlossaryConfig GlossaryConfig { get; set; }
Optional. Glossary to be applied. The glossary must be
within the same region (have the same location-id) as the model, otherwise
an INVALID_ARGUMENT (400) error is returned.
Optional. The labels with user-defined metadata for the request.
Label keys and values can be no longer than 63 characters
(Unicode codepoints), can only contain lowercase letters, numeric
characters, underscores and dashes. International characters are allowed.
Label values are optional. Label keys must start with a letter.
Optional. The ISO-639 language code of the input text if
known, for example, "en-US" or "sr-Latn". Supported language codes are
listed in Language Support. If the source language isn't specified, the API
attempts to identify the source language automatically and returns the
source language within the response.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-07 UTC."],[[["\u003cp\u003eThe \u003ccode\u003eTranslateTextRequest\u003c/code\u003e class is used for synchronous translation requests in the Google Cloud Translation v3 API, and it is the request message used for this process.\u003c/p\u003e\n"],["\u003cp\u003eThis class implements several interfaces including \u003ccode\u003eIMessage\u003c/code\u003e, \u003ccode\u003eIEquatable\u003c/code\u003e, \u003ccode\u003eIDeepCloneable\u003c/code\u003e, and \u003ccode\u003eIBufferMessage\u003c/code\u003e, enhancing its functionality and usability within .NET environments.\u003c/p\u003e\n"],["\u003cp\u003eThe class includes properties for specifying translation parameters, such as \u003ccode\u003eContents\u003c/code\u003e (text to be translated), \u003ccode\u003eTargetLanguageCode\u003c/code\u003e (the desired output language), and \u003ccode\u003eModel\u003c/code\u003e (the specific translation model to use).\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eParent\u003c/code\u003e property is required to specify the project or location for the translation request, while several properties such as \u003ccode\u003eMimeType\u003c/code\u003e and \u003ccode\u003eSourceLanguageCode\u003c/code\u003e are optional parameters.\u003c/p\u003e\n"],["\u003cp\u003eThere are 13 versions of the documentation available, ranging from version 3.9.0 down to 2.2.0, with version 3.9.0 being the latest release.\u003c/p\u003e\n"]]],[],null,["# Google Cloud Translation v3 API - Class TranslateTextRequest (3.9.0)\n\nVersion latestkeyboard_arrow_down\n\n- [3.9.0 (latest)](/dotnet/docs/reference/Google.Cloud.Translate.V3/latest/Google.Cloud.Translate.V3.TranslateTextRequest)\n- [3.8.0](/dotnet/docs/reference/Google.Cloud.Translate.V3/3.8.0/Google.Cloud.Translate.V3.TranslateTextRequest)\n- [3.7.0](/dotnet/docs/reference/Google.Cloud.Translate.V3/3.7.0/Google.Cloud.Translate.V3.TranslateTextRequest)\n- [3.6.0](/dotnet/docs/reference/Google.Cloud.Translate.V3/3.6.0/Google.Cloud.Translate.V3.TranslateTextRequest)\n- [3.5.0](/dotnet/docs/reference/Google.Cloud.Translate.V3/3.5.0/Google.Cloud.Translate.V3.TranslateTextRequest)\n- [3.4.0](/dotnet/docs/reference/Google.Cloud.Translate.V3/3.4.0/Google.Cloud.Translate.V3.TranslateTextRequest)\n- [3.3.0](/dotnet/docs/reference/Google.Cloud.Translate.V3/3.3.0/Google.Cloud.Translate.V3.TranslateTextRequest)\n- [3.2.0](/dotnet/docs/reference/Google.Cloud.Translate.V3/3.2.0/Google.Cloud.Translate.V3.TranslateTextRequest)\n- [3.1.0](/dotnet/docs/reference/Google.Cloud.Translate.V3/3.1.0/Google.Cloud.Translate.V3.TranslateTextRequest)\n- [3.0.0](/dotnet/docs/reference/Google.Cloud.Translate.V3/3.0.0/Google.Cloud.Translate.V3.TranslateTextRequest)\n- [2.4.0](/dotnet/docs/reference/Google.Cloud.Translate.V3/2.4.0/Google.Cloud.Translate.V3.TranslateTextRequest)\n- [2.3.0](/dotnet/docs/reference/Google.Cloud.Translate.V3/2.3.0/Google.Cloud.Translate.V3.TranslateTextRequest)\n- [2.2.0](/dotnet/docs/reference/Google.Cloud.Translate.V3/2.2.0/Google.Cloud.Translate.V3.TranslateTextRequest) \n\n public sealed class TranslateTextRequest : IMessage\u003cTranslateTextRequest\u003e, IEquatable\u003cTranslateTextRequest\u003e, IDeepCloneable\u003cTranslateTextRequest\u003e, IBufferMessage, IMessage\n\nReference documentation and code samples for the Google Cloud Translation v3 API class TranslateTextRequest.\n\nThe request message for synchronous translation. \n\nInheritance\n-----------\n\n[object](https://learn.microsoft.com/dotnet/api/system.object) \\\u003e TranslateTextRequest \n\nImplements\n----------\n\n[IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage-1.html)[TranslateTextRequest](/dotnet/docs/reference/Google.Cloud.Translate.V3/latest/Google.Cloud.Translate.V3.TranslateTextRequest), [IEquatable](https://learn.microsoft.com/dotnet/api/system.iequatable-1)[TranslateTextRequest](/dotnet/docs/reference/Google.Cloud.Translate.V3/latest/Google.Cloud.Translate.V3.TranslateTextRequest), [IDeepCloneable](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IDeepCloneable-1.html)[TranslateTextRequest](/dotnet/docs/reference/Google.Cloud.Translate.V3/latest/Google.Cloud.Translate.V3.TranslateTextRequest), [IBufferMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IBufferMessage.html), [IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage.html) \n\nInherited Members\n-----------------\n\n[object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) \n[object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype) \n[object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)\n\nNamespace\n---------\n\n[Google.Cloud.Translate.V3](/dotnet/docs/reference/Google.Cloud.Translate.V3/latest/Google.Cloud.Translate.V3)\n\nAssembly\n--------\n\nGoogle.Cloud.Translate.V3.dll\n\nConstructors\n------------\n\n### TranslateTextRequest()\n\n public TranslateTextRequest()\n\n### TranslateTextRequest(TranslateTextRequest)\n\n public TranslateTextRequest(TranslateTextRequest other)\n\nProperties\n----------\n\n### Contents\n\n public RepeatedField\u003cstring\u003e Contents { get; }\n\nRequired. The content of the input in string format.\nWe recommend the total content be less than 30,000 codepoints. The max\nlength of this field is 1024. Use BatchTranslateText for larger text.\n\n### GlossaryConfig\n\n public TranslateTextGlossaryConfig GlossaryConfig { get; set; }\n\nOptional. Glossary to be applied. The glossary must be\nwithin the same region (have the same location-id) as the model, otherwise\nan INVALID_ARGUMENT (400) error is returned.\n\n### Labels\n\n public MapField\u003cstring, string\u003e Labels { get; }\n\nOptional. The labels with user-defined metadata for the request.\n\nLabel keys and values can be no longer than 63 characters\n(Unicode codepoints), can only contain lowercase letters, numeric\ncharacters, underscores and dashes. International characters are allowed.\nLabel values are optional. Label keys must start with a letter.\n\nSee \u003chttps://cloud.google.com/translate/docs/advanced/labels\u003e for more\ninformation.\n\n### MimeType\n\n public string MimeType { get; set; }\n\nOptional. The format of the source text, for example, \"text/html\",\n\"text/plain\". If left blank, the MIME type defaults to \"text/html\".\n\n### Model\n\n public string Model { get; set; }\n\nOptional. The `model` type requested for this translation.\n\nThe format depends on model type:\n\n- AutoML Translation models:\n `projects/{project-number-or-id}/locations/{location-id}/models/{model-id}`\n\n- General (built-in) models:\n `projects/{project-number-or-id}/locations/{location-id}/models/general/nmt`,\n\n- Translation LLM models:\n `projects/{project-number-or-id}/locations/{location-id}/models/general/translation-llm`,\n\nFor global (non-regionalized) requests, use `location-id` `global`.\nFor example,\n`projects/{project-number-or-id}/locations/global/models/general/nmt`.\n\nIf not provided, the default Google model (NMT) will be used\n\n### Parent\n\n public string Parent { get; set; }\n\nRequired. Project or location to make a call. Must refer to a caller's\nproject.\n\nFormat: `projects/{project-number-or-id}` or\n`projects/{project-number-or-id}/locations/{location-id}`.\n\nFor global calls, use `projects/{project-number-or-id}/locations/global` or\n`projects/{project-number-or-id}`.\n\nNon-global location is required for requests using AutoML models or\ncustom glossaries.\n\nModels and glossaries must be within the same region (have same\nlocation-id), otherwise an INVALID_ARGUMENT (400) error is returned.\n\n### ParentAsLocationName\n\n public LocationName ParentAsLocationName { get; set; }\n\n[LocationName](https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.ResourceNames.LocationName.html)-typed view over the [Parent](/dotnet/docs/reference/Google.Cloud.Translate.V3/latest/Google.Cloud.Translate.V3.TranslateTextRequest#Google_Cloud_Translate_V3_TranslateTextRequest_Parent) resource name property.\n\n### SourceLanguageCode\n\n public string SourceLanguageCode { get; set; }\n\nOptional. The ISO-639 language code of the input text if\nknown, for example, \"en-US\" or \"sr-Latn\". Supported language codes are\nlisted in Language Support. If the source language isn't specified, the API\nattempts to identify the source language automatically and returns the\nsource language within the response.\n\n### TargetLanguageCode\n\n public string TargetLanguageCode { get; set; }\n\nRequired. The ISO-639 language code to use for translation of the input\ntext, set to one of the language codes listed in Language Support.\n\n### TransliterationConfig\n\n public TransliterationConfig TransliterationConfig { get; set; }\n\nOptional. Transliteration to be applied."]]