[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-04 UTC."],[[["\u003cp\u003eThis documentation covers the \u003ccode\u003eDetection\u003c/code\u003e class within the Google Cloud Translation v2 API, which is used to represent the result of a language detection operation.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eDetection\u003c/code\u003e class can be instantiated with parameters for \u003ccode\u003etext\u003c/code\u003e, \u003ccode\u003elanguage\u003c/code\u003e, \u003ccode\u003econfidence\u003c/code\u003e, and \u003ccode\u003eisReliable\u003c/code\u003e, and is located in the \u003ccode\u003eGoogle.Cloud.Translation.V2\u003c/code\u003e namespace.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eDetection\u003c/code\u003e class exposes read-only properties including \u003ccode\u003eConfidence\u003c/code\u003e (a float representing the detection's confidence), \u003ccode\u003eIsReliable\u003c/code\u003e (a boolean indicating the detection's reliability), \u003ccode\u003eLanguage\u003c/code\u003e (a string for the detected language code), and \u003ccode\u003eText\u003c/code\u003e (a string of the text used for language detection).\u003c/p\u003e\n"],["\u003cp\u003eThe documentation is versioned, with the latest version being 3.4.0, and includes links to documentation for previous versions ranging from 3.3.0 down to 2.1.0.\u003c/p\u003e\n"]]],[],null,["# Google Cloud Translation v2 API - Class Detection (3.4.0)\n\nVersion latestkeyboard_arrow_down\n\n- [3.4.0 (latest)](/dotnet/docs/reference/Google.Cloud.Translation.V2/latest/Google.Cloud.Translation.V2.Detection)\n- [3.3.0](/dotnet/docs/reference/Google.Cloud.Translation.V2/3.3.0/Google.Cloud.Translation.V2.Detection)\n- [3.2.0](/dotnet/docs/reference/Google.Cloud.Translation.V2/3.2.0/Google.Cloud.Translation.V2.Detection)\n- [3.1.0](/dotnet/docs/reference/Google.Cloud.Translation.V2/3.1.0/Google.Cloud.Translation.V2.Detection)\n- [3.0.0](/dotnet/docs/reference/Google.Cloud.Translation.V2/3.0.0/Google.Cloud.Translation.V2.Detection)\n- [2.1.0](/dotnet/docs/reference/Google.Cloud.Translation.V2/2.1.0/Google.Cloud.Translation.V2.Detection) \n\n public sealed class Detection\n\nReference documentation and code samples for the Google Cloud Translation v2 API class Detection.\n\nA result of detecting the language of a piece of text\nvia [DetectLanguage(string)](/dotnet/docs/reference/Google.Cloud.Translation.V2/latest/Google.Cloud.Translation.V2.TranslationClient#Google_Cloud_Translation_V2_TranslationClient_DetectLanguage_System_String_) or\n[DetectLanguageAsync(string, CancellationToken)](/dotnet/docs/reference/Google.Cloud.Translation.V2/latest/Google.Cloud.Translation.V2.TranslationClient#Google_Cloud_Translation_V2_TranslationClient_DetectLanguageAsync_System_String_System_Threading_CancellationToken_),\nor the multiple-item equivalents. \n\nInheritance\n-----------\n\n[object](https://learn.microsoft.com/dotnet/api/system.object) \\\u003e Detection \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.Translation.V2](/dotnet/docs/reference/Google.Cloud.Translation.V2/latest/Google.Cloud.Translation.V2)\n\nAssembly\n--------\n\nGoogle.Cloud.Translation.V2.dll\n\nConstructors\n------------\n\n### Detection(string, string, float, bool)\n\n public Detection(string text, string language, float confidence, bool isReliable)\n\nConstructs a new instance.\n\nProperties\n----------\n\n### Confidence\n\n public float Confidence { get; }\n\nThe confidence level (between 0 and 1) of the detection.\n\n### IsReliable\n\n public bool IsReliable { get; }\n\nThe reliability of the detection.\n\n### Language\n\n public string Language { get; }\n\nThe language code for the detected language.\n\n### Text\n\n public string Text { get; }\n\nThe text that was used for the input of language detection."]]