GroupDocs.Translation Cloud is a simple SDK used to add translation of Microsoft Word documents, Microsoft Excel workbooks, Microsoft PowerPoint presentations, Adobe PDF documents, Markdown files, OpeDocument files, ResX files, SRT files, text files and plain text to your app with merely a few lines of code. In detail, it's a set of SDKs for document and plain text translation in our Cloud. It supports translaton of .doc, .docx, .docm, .xls, .xlsx, .xlsm, .ppt, .pptx, .pptm, .pdf, .md, .odt, .ods, .odp, .csv, .tsv, .rtf, .txt, .resx, .srt files. Just pass a specific file or text to the GroupDocs.Translation Cloud API, and it will translate to one or several languages and save translated files in our Cloud or will return translated texts.
$ dotnet add package GroupDocs.Translation-CloudProduct Page | Docs | Demos | Swagger UI | Examples | Blog | Search | Free Support | Free Trial
GroupDocs.Translation Cloud is Cloud API to translate Word (including RTF and TXT files), Excel (including CSV / TSV files), PowerPoint, PDF, HTML, Markdown (including Markdown with Hugo syntax), OpenDocument, RESX, SRT files, images of JPG, PNG, SVG, BMP and GIF formats, scanned PDFs audio and video files as well as plain text. Besides general vocabulary, it provides medical translation, slang translation and summarization translation.
For convenience of our .NET customers, we introduce a simple SDK that assists to add translation of all document, image and media file formats mentioned above and plain text to your app with merely a few lines of code.
In detail, it's a set of SDKs for document and plain text translation in our Cloud. It supports translation of .doc, .docx, .docm, .xls, .xlsx, .xlsm, .ppt, .pptx, .pptm, .pdf, .html, .md, .odt, .ods, .odp, .csv, .tsv, .rtf, .txt, .resx, .srt, .png, .jpg, .svg, .bmp and .gif files. Just pass a specific file or text to the GroupDocs.Translation Cloud API, and it will translate and save translated file in S3 or will return translated text.
It is easy to get started with GroupDocs.Translation Cloud and there is nothing to install. Create an account at GroupDocs Cloud and get your application information, then you are ready to use SDKs.
You shoukd specify format of document to translate putting in the request’s body the appropriate enum value.
Additionally, user could obtain translated file in any other format available for conversion. Just specify output format of translated document by putting file extension in the request’s body:
Please visit Supported Formats for details.
You can put the following information in the requests body to translate a document:
To translate plain text the following information should be put in the requests body:
Our API is completely independent of your operating system, database system, or development language. You can use any language and platform that supports HTTP to interact with our API. However, manually writing client code can be difficult, error-prone, and time-consuming. Therefore, we provide and support SDKs in many development languages to make it easier for your Cloud Apps to integrate with us.
Make a personal account on GroupDocs Cloud Dashboard and click Get Keys. These keys are useful for all GroupDocs Cloud products. If you have any trouble, look at this detailed manual. Once your keys are received, please follow this article to try GroupDocs.Translation Cloud or familiarize with Developer guide for further details.
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Threading;
using GroupDocs.Translation.Cloud.Sdk.Api;
using GroupDocs.Translation.Cloud.Sdk.Client;
using GroupDocs.Translation.Cloud.Sdk.Client.Auth;
using GroupDocs.Translation.Cloud.Sdk.Extensions;
using GroupDocs.Translation.Cloud.Sdk.Model;
using HttpStatusCode = System.Net.HttpStatusCode;
namespace GroupDocs.Translation.Cloud.Sdk
{
public class TextTranslator
{
public TextTranslator()
{
Configuration config = new Configuration();
/** 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";
TranslationApi apiInstance = new TranslationApi(config);
/** Specify translation parameters */
string translateFrom = new List<string>() { "Hello, world! I can read this text in my language." };
string sourceLanguage = "en";
var targetLanguages = new List<string>() { "de" };
var request = new TextRequest(sourceLanguage, targetLanguages, translateFrom, origin: "demo");
/** Send text to translation */
StatusResponse translationStatus = apiInstance.TextPost(request);
/** Wait for results from translation queue */
if(translationStatus.Status.ToSystemHttpStatusCode() == HttpStatusCode.Accepted)
{
while(true)
{
var result = apiInstance.TextRequestIdGet(statusResponse.Id);
if(result.Status.ToSystemHttpStatusCode() == HttpStatusCode.OK)
{
Console.WriteLine(result.Translations[toLang].First());
break;
}
Thread.Sleep(1000);
}
}
}
}
}
All URIs are relative to https://api.groupdocs.cloud/v2.0/translation
| Class | Method | HTTP request | Description |
|---|---|---|---|
| TranslationApi | autoPost | POST /auto | Translate any supported file |
| TranslationApi | csvPost | POST /csv | Translate CSV and TSV files |
| TranslationApi | documentPost | POST /document | Translate Microsoft Word documents, rtf, txt, odt |
| TranslationApi | documentRequestIdGet | GET /document/{requestId} | Return document translation status. Also return URLs for downloading of translated document if translation was successful |
| TranslationApi | documentTrialPost | POST /document/trial | Trial translate Microsoft Word documents, rtf, txt, odt without conversation. Translate only first page or 1000 symbols. |
| TranslationApi | hcGet | GET /hc | Health check for all services. |
| TranslationApi | htmlPost | POST /html | Translate HTML files |
| TranslationApi | hugoGet | GET /hugo | Get hugo syntax structure from markdown file |
| TranslationApi | hugoPost | POST /hugo | Run hugo syntax structure analyzing from markdown file |
| TranslationApi | imageToFilePost | POST /image-to-file | Translate image or scanned pdf and return file |
| TranslationApi | imageToTextPost | POST /image-to-text | Translate text on image or scanned pdf |
| TranslationApi | languagesGet | GET /languages | Return list of available language pairs |
| TranslationApi | markdownPost | POST /markdown | Translate Markdown files |
| TranslationApi | pdfPost | POST /pdf | Translate pdf files |
| TranslationApi | pdfTrialPost | POST /pdf/trial | Trial pdf translation. Translate only first page without conversion to another format. |
| TranslationApi | presentationPost | POST /presentation | Translate Microsoft PowerPoint presentations, odp |
| TranslationApi | resxPost | POST /resx | Translate RESX files |
| TranslationApi | spreadsheetPost | POST /spreadsheet | Translate Microsoft Excel workbooks, ods |
| TranslationApi | textPost | POST /text | Translate text |
| TranslationApi | textRequestIdGet | GET /text/{requestId} | Return text translation status. Also return translated text if translation was successful |
| TranslationApi | textTrialPost | POST /text/trial | Trial translate text. Translate only 1000 symbols. |
Product Page | Docs | Demos | Swagger UI | Examples | Blog | Search | Free Support | Free Trial