Skip to main content
.NETStandard2.0

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.

Published
Sep 27, 2023
3y ago
Total Downloads
79.9K
79,871

Install

dotnet add package GroupDocs.Translation-Cloud --version 23.9.4
ProductVersions
.NET Standard
netstandard2.0

README

GroupDocs.Translation.Cloud.Sdk (.NET)

No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)

This C# SDK is automatically generated by the OpenAPI Generator project:

Frameworks supported

  • .NET Core >=1.0
  • .NET Framework >=4.6
  • Mono/Xamarin >=vNext

Dependencies

The DLLs included in the package may not be the latest version. We recommend using NuGet to obtain the latest version of the packages:

Install-Package RestSharp
Install-Package Newtonsoft.Json
Install-Package JsonSubTypes
Install-Package System.ComponentModel.Annotations

NOTE: RestSharp versions greater than 105.1.0 have a bug which causes file uploads to fail. See RestSharp#742. NOTE: RestSharp for .Net Core creates a new socket for each api call, which can lead to a socket exhaustion problem. See RestSharp#1406.

Installation

Generate the DLL using your preferred tool (e.g. dotnet build)

Then include the DLL (under the bin folder) in the C# project, and use the namespaces:

using GroupDocs.Translation.Cloud.Sdk.Api;
using GroupDocs.Translation.Cloud.Sdk.Client;
using GroupDocs.Translation.Cloud.Sdk.Model;

Usage

To use the API client with a HTTP proxy, setup a System.Net.WebProxy

Configuration c = new Configuration();
System.Net.WebProxy webProxy = new System.Net.WebProxy("http://myProxyUrl:80/");
webProxy.Credentials = System.Net.CredentialCache.DefaultCredentials;
c.Proxy = webProxy;

Getting Started

using System.Collections.Generic;
using System.Diagnostics;
using GroupDocs.Translation.Cloud.Sdk.Api;
using GroupDocs.Translation.Cloud.Sdk.Client;
using GroupDocs.Translation.Cloud.Sdk.Model;

namespace Example
{
    public class Example
    {
        public static void Main()
        {

            Configuration config = new Configuration();
            config.BasePath = "https://api.groupdocs.cloud/v2.0/translation";
            // Configure OAuth2 ClientId and ClientSecret: JWT
            config.OAuthClientId = "YOU_CLIENT_ID";
            config.OAuthClientSecret = "YOU_CLIENT_SECRET";
            config.OAuthFlow = OAuthFlow.APPLICATION;

            var apiInstance = new TranslationApi(config);
            var fileRequest = new FileRequest(); // FileRequest | String in body of request, containing JSON with parameters for translation. (optional) 

            try
            {
                // Translate any supported file
                StatusResponse result = apiInstance.AutoPost(fileRequest);
                Debug.WriteLine(result);
            }
            catch (ApiException e)
            {
                Debug.Print("Exception when calling TranslationApi.AutoPost: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }

        }
    }
}

Documentation for API Endpoints

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.

Documentation for Models

Documentation for Authorization

JWT

Changes from Previous Version

v23.9.3-prev23.9.4
Removed Dependencies

Adoption Assessment

A verified publisher signal is available. Assess fit from the package's supported frameworks, license and dependency graph rather than popularity alone.

No SPDX license expression is published. Review the license text and your organisation's policy before redistribution.Compatibility metadata lists 1 target framework; confirm the exact target used by your application.

Related Guides & Workflows

Learn how to evaluate, integrate, or audit this package in your .NET project.