[[["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\u003eThe \u003ccode\u003eServiceCollectionExtensions\u003c/code\u003e class provides extension methods to configure API clients for the Google Cloud Translation v3 API.\u003c/p\u003e\n"],["\u003cp\u003eThe latest version of the API documentation available is version 3.9.0, and documentation exists for versions back to 2.2.0.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eAddTranslationServiceClient\u003c/code\u003e method allows you to add a singleton \u003ccode\u003eTranslationServiceClient\u003c/code\u003e to the \u003ccode\u003eIServiceCollection\u003c/code\u003e, which can be configured using an optional action.\u003c/p\u003e\n"],["\u003cp\u003eThe class inherits from \u003ccode\u003eobject\u003c/code\u003e and provides methods for managing the \u003ccode\u003eTranslationServiceClient\u003c/code\u003e within a service collection.\u003c/p\u003e\n"]]],[],null,["# Google Cloud Translation v3 API - Class ServiceCollectionExtensions (3.9.0)\n\nVersion latestkeyboard_arrow_down\n\n- [3.9.0 (latest)](/dotnet/docs/reference/Google.Cloud.Translate.V3/latest/Microsoft.Extensions.DependencyInjection.ServiceCollectionExtensions)\n- [3.8.0](/dotnet/docs/reference/Google.Cloud.Translate.V3/3.8.0/Microsoft.Extensions.DependencyInjection.ServiceCollectionExtensions)\n- [3.7.0](/dotnet/docs/reference/Google.Cloud.Translate.V3/3.7.0/Microsoft.Extensions.DependencyInjection.ServiceCollectionExtensions)\n- [3.6.0](/dotnet/docs/reference/Google.Cloud.Translate.V3/3.6.0/Microsoft.Extensions.DependencyInjection.ServiceCollectionExtensions)\n- [3.5.0](/dotnet/docs/reference/Google.Cloud.Translate.V3/3.5.0/Microsoft.Extensions.DependencyInjection.ServiceCollectionExtensions)\n- [3.4.0](/dotnet/docs/reference/Google.Cloud.Translate.V3/3.4.0/Microsoft.Extensions.DependencyInjection.ServiceCollectionExtensions)\n- [3.3.0](/dotnet/docs/reference/Google.Cloud.Translate.V3/3.3.0/Microsoft.Extensions.DependencyInjection.ServiceCollectionExtensions)\n- [3.2.0](/dotnet/docs/reference/Google.Cloud.Translate.V3/3.2.0/Microsoft.Extensions.DependencyInjection.ServiceCollectionExtensions)\n- [3.1.0](/dotnet/docs/reference/Google.Cloud.Translate.V3/3.1.0/Microsoft.Extensions.DependencyInjection.ServiceCollectionExtensions)\n- [3.0.0](/dotnet/docs/reference/Google.Cloud.Translate.V3/3.0.0/Microsoft.Extensions.DependencyInjection.ServiceCollectionExtensions)\n- [2.4.0](/dotnet/docs/reference/Google.Cloud.Translate.V3/2.4.0/Microsoft.Extensions.DependencyInjection.ServiceCollectionExtensions)\n- [2.3.0](/dotnet/docs/reference/Google.Cloud.Translate.V3/2.3.0/Microsoft.Extensions.DependencyInjection.ServiceCollectionExtensions)\n- [2.2.0](/dotnet/docs/reference/Google.Cloud.Translate.V3/2.2.0/Microsoft.Extensions.DependencyInjection.ServiceCollectionExtensions) \n\n public static class ServiceCollectionExtensions\n\nReference documentation and code samples for the Google Cloud Translation v3 API class ServiceCollectionExtensions.\n\nStatic class to provide extension methods to configure API clients. \n\nInheritance\n-----------\n\n[object](https://learn.microsoft.com/dotnet/api/system.object) \\\u003e ServiceCollectionExtensions \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.MemberwiseClone()](https://learn.microsoft.com/dotnet/api/system.object.memberwiseclone) \n[object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)\n\nNamespace\n---------\n\n[Microsoft.Extensions.DependencyInjection](/dotnet/docs/reference/Google.Cloud.Translate.V3/latest/Microsoft.Extensions.DependencyInjection)\n\nAssembly\n--------\n\nGoogle.Cloud.Translate.V3.dll\n\nMethods\n-------\n\n### AddTranslationServiceClient(IServiceCollection, Action\\\u003cTranslationServiceClientBuilder\\\u003e)\n\n public static IServiceCollection AddTranslationServiceClient(this IServiceCollection services, Action\u003cTranslationServiceClientBuilder\u003e action = null)\n\nAdds a singleton [TranslationServiceClient](/dotnet/docs/reference/Google.Cloud.Translate.V3/latest/Google.Cloud.Translate.V3.TranslationServiceClient) to `services`.\n\n### AddTranslationServiceClient(IServiceCollection, Action\\\u003cIServiceProvider, TranslationServiceClientBuilder\\\u003e)\n\n public static IServiceCollection AddTranslationServiceClient(this IServiceCollection services, Action\u003cIServiceProvider, TranslationServiceClientBuilder\u003e action)\n\nAdds a singleton [TranslationServiceClient](/dotnet/docs/reference/Google.Cloud.Translate.V3/latest/Google.Cloud.Translate.V3.TranslationServiceClient) to `services`."]]