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 11, 2023
3y ago
Total Downloads
79.9K
79,871

Install

dotnet add package GroupDocs.Translation-Cloud --version 23.9.3-pre
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:

  • API version: 23.9.2
  • SDK version: 1.0.0
  • Build package: org.openapitools.codegen.languages.CSharpNetCoreClientCodegen

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 autoPostRequest = new AutoPostRequest(); // AutoPostRequest |  (optional) 

            try
            {
                StatusResponse result = apiInstance.AutoPost(autoPostRequest);
                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
TranslationApi CsvPost POST /csv
TranslationApi DocumentPost POST /document
TranslationApi DocumentRequestIdGet GET /document/{requestId}
TranslationApi HcGet GET /hc
TranslationApi HtmlPost POST /html
TranslationApi HugoGet GET /hugo
TranslationApi HugoPost POST /hugo
TranslationApi ImageToFilePost POST /image-to-file
TranslationApi ImageToTextPost POST /image-to-text
TranslationApi LanguagesGet GET /languages
TranslationApi MarkdownPost POST /markdown
TranslationApi PdfPost POST /pdf
TranslationApi PresentationPost POST /presentation
TranslationApi ResxPost POST /resx
TranslationApi SpreadsheetsPost POST /spreadsheets
TranslationApi TextPost POST /text
TranslationApi TextRequestIdGet GET /text/{requestId}

Documentation for Models

Documentation for Authorization

JWT

Changes from Previous Version

v23.9.0-prev23.9.3-pre
Added 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.

This version is marked prerelease. Validate its API and upgrade path before production use.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.