GroupDocs offers software development kits (SDKs) for popular programming languages that make interaction with GroupDocs.Translation cloud services much easier. It allows you to focus on business logic rather than the technical details.
SDKs handle all the routine operations such as establishing connections, sending API requests, and parsing responses, wrapping all these tasks into a few simple methods. The following programming languages are supported:
GroupDocs.Translation Cloud for Android Extend your mobile apps with translation features. GroupDocs.Translation service runs in the cloud and supports even entry-level and legacy smartphones.
All SDKs are open-source distributed under MIT License. You can freely use them for any projects, including commercial and proprietary applications, as well as modify any part of the code.
The provided code is fully tested and ready to run out of the box.
SDK usage examples
See the examples below for a quick overview of how SDKs can make your development easier.
Translating the text
usingSystem.Collections.Generic;usingSystem.Diagnostics;usingSystem.Linq;usingSystem.Threading;usingGroupDocs.Translation.Cloud.Sdk.Api;usingGroupDocs.Translation.Cloud.Sdk.Client;usingGroupDocs.Translation.Cloud.Sdk.Client.Auth;usingGroupDocs.Translation.Cloud.Sdk.Extensions;usingGroupDocs.Translation.Cloud.Sdk.Model;usingHttpStatusCode=System.Net.HttpStatusCode;namespaceGroupDocs.Translation.Cloud.Sdk{publicclassTextTranslator{publicTextTranslator(){Configurationconfig=newConfiguration();/** Authorize your requests to GroupDocs.Translation Cloud */config.OAuthFlow=OAuthFlow.APPLICATION;config.OAuthClientId="YOU_CLIENT_ID";config.OAuthClientSecret="YOU_CLIENT_SECRET";/** Initialize GroupDocs.Translation API */config.BasePath="https://api.groupdocs.cloud/v2.0/translation";TranslationApiapiInstance=newTranslationApi(config);/** Specify translation parameters */stringtranslateFrom=newList<string>(){"Hello, world! I can read this text in my language."};stringsourceLanguage="en";vartargetLanguages=newList<string>(){"de"};varrequest=newTextRequest(sourceLanguage,targetLanguages,translateFrom,origin:"demo");/** Send text to translation */StatusResponsetranslationStatus=apiInstance.TextPost(request);/** Wait for results from translation queue */if(translationStatus.Status.ToSystemHttpStatusCode()==HttpStatusCode.Accepted){while(true){varresult=apiInstance.TextRequestIdGet(statusResponse.Id);if(result.Status.ToSystemHttpStatusCode()==HttpStatusCode.OK){Console.WriteLine(result.Translations[toLang].First());break;}Thread.Sleep(1000);}}}}}