<dependency>
<groupId>com.groupdocs</groupId>
<artifactId>groupdocs-translation-cloud</artifactId>
<version>25.7</version>
</dependency>compile(group: 'com.groupdocs', name: 'groupdocs-translation-cloud', version: '25.7')<dependency org="com.groupdocs" name="groupdocs-translation-cloud" rev="25.7">
<artifact name="groupdocs-translation-cloud" ext="jar"/>
</dependency>libraryDependencies += "com.groupdocs" % "groupdocs-translation-cloud" % "25.7"Java SDK for Translating Cloud Documents
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 and scanned PDFs as well as plain text.
For convenience of our Java customers, we introduce a simple SDK that assists to add translation of all document and image file formats mmentions 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.
Requirements
Building the API client library requires:
- Java 1.8+
- Maven (3.8.3+)/Gradle (7.2+)
Installation
To install the API client library to your local Maven repository, simply execute:
mvn clean install
To deploy it to a remote Maven repository instead, configure the settings of the repository and execute:
mvn clean deploy
Refer to the OSSRH Guide for more information.
Maven users
Add this dependency to your project’s POM:
<dependency>
<groupId>com.groupdocs</groupId>
<artifactId>GroupDocs-translation-cloud</artifactId>
<version>23.10</version>
<scope>compile</scope>
</dependency>
Gradle users
Add this dependency to your project’s build file:
repositories {
mavenCentral() // Needed if the 'GroupDocs-translation-cloud' jar has been published to maven central.
mavenLocal() // Needed if the 'GroupDocs-translation-cloud' jar has been published to the local maven repo.
}
dependencies {
implementation "com.groupdocs:GroupDocs-translation-cloud:23.10"
}
Others
At first generate the JAR by executing:
mvn clean package
Then manually install the following JARs:
target/GroupDocs-translation-cloud-23.10.jartarget/lib/*.jar
Getting Started
Please follow the installation instruction and execute the following Java code:
// Import classes:
import com.groupdocs.ApiClient;
import com.groupdocs.ApiException;
import com.groupdocs.Configuration;
import com.groupdocs.auth.*;
import com.groupdocs.models.*;
import org.openapitools.client.api.TranslationApi;
public class Example {
public static void main(String[] args) {
String basePath = "https://api.groupdocs.cloud/v2.0/translation";
String cliendId = "YOUR_CLIENT_ID";
String clientSecret = "YOUR_CLIENT_SECRET";
ApiClient defaultClient = new ApiClient(basePath, cliendId, clientSecret, null);
TranslationApi apiInstance = new TranslationApi(defaultClient);
// FileRequest fileRequest = new FileRequest(); // FileRequest | String in body of request, containing JSON with parameters for translation.
TextRequest request = new TextRequest();
request.setSourceLanguage("en");
request.addTargetLanguagesItem("de");
request.addTextsItem("Text to translate");
try {
CloudTextResponse cloudTextResponse = apiInstance.textRequestIdGet(apiInstance.textPost(request).getId());
System.out.println(cloudTextResponse);
} catch (ApiException e) {
System.err.println("Exception when calling TranslationApi#autoPost");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
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
CloudFileResponse,CloudHugoResponse,CloudTextResponse,CsvFileRequest,FileRequest,HealthCheckStatus,HtmlFileRequest,HttpStatusCode,HugoRequest,ImageToFileRequest,ImageToTextRequest,LanguagePairData,MarkdownFileRequest,PdfFileRequest,PresentationFileRequest,ResxFileRequest,SpreadsheetFileRequest,StatusResponse,StringStringTuple,TextDocumentFileRequest,TextRequest,UrlFileInfo,WorksheetData
GroupDocs.Translation Cloud SKDs
GitHub
Package Manager
| Version | Release Date |
|---|---|
| 25.7 | July 31, 2025 |
| 25.2 | February 27, 2025 |
| 24.12 | December 24, 2024 |
| 24.11 | November 30, 2024 |
| 24.5 | May 31, 2024 |
| 24.3 | March 22, 2024 |
| 24.1 | January 31, 2024 |
| 23.10 | December 11, 2023 |
| 23.1 | January 26, 2023 |
| 22.8 | September 1, 2022 |
| 22.5 | May 24, 2022 |
| 22.4 | April 27, 2022 |
| 22.2 | March 1, 2022 |
| 20.8.0 | January 25, 2022 |
| 20.12.0 | December 22, 2020 |
| 20.10.0 | November 4, 2020 |
GroupDocs Java REST API Maven SDK Java SDK Cloud REST REST API Cloud API MIT JWT oauth GroupDocs.Total Cloud GroupDocs.Translation Cloud JAR document automation document automation cloud document DOC DOCX DOCM RTF ODT XLS XLSX XLSM CSV TSV ODS PPT PPTX PPTM ODP PDF MD Markdown translate translator multi lingual language language pair translation pair JSON paragraph header footer footnote endnote image caption table pivot cells charts master slide notes comments frames convert conversion converter French English German Deutsch Chinese Spanish Italian Russian Arabic Portuguese Polish Ukrainian Vietnamese Indonesian Hindi Greek Dutch Hungarian Swedish Turkish Japanese Korean Czech Finnish Irish Slovak Farsi Persian Hebrew Azerbaijani Thai Romanian Malay Bulgarian English to French French to English English to German German to English English to Deutsch Deutsch to English English to Chinese Chinese to English English to Spanish Spanish to English English to Italian Italian to English English to Russian Russian to English English to Arabic Arabic to English English to Portuguese Portuguese to English English to Polish Polish to English English to Ukrainian Ukrainian to English English to Vietnamese Vietnamese to English English to Indonesian Indonesian to English English to Hindi Hindi to English English to Greek Greek to English English to Dutch Dutch to English English to Hungarian Hungarian to English English to Swedish Swedish to English English to Turkish Turkish to English English to Japanese Japanese to English English to Korean Korean to English English to Czech Czech to English English to Finnish Finnish to English English to Irish Irish to English English to Slovak Slovak to English English to Farsi Farsi to English English to Persian Persian to English English to Hebrew Hebrew to English English to Azerbaijani Azerbaijani to English English to Thai Thai to English English to Romanian Romanian to English English to Malay Malay to English English to Bulgarian Bulgarian to English French to German German to French French to Deutsch Deutsch to French French to Italian Italian to French French to Arabic Arabic to French

