X Tutup
Skip to content

Latest commit

 

History

History
 
 

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

README.md

Language Translator

Installation

Maven
<dependency>
  <groupId>com.ibm.watson.developer_cloud</groupId>
  <artifactId>language-translator</artifactId>
  <version>5.3.0</version>
</dependency>
Gradle
'com.ibm.watson.developer_cloud:language-translator:5.3.0'

Usage

Select a domain, then identify or select the language of text, and then translate the text from one supported language to another.
Example: Translate 'hello' from English to Spanish using the Language Translator service.

LanguageTranslator service = new LanguageTranslator();
service.setUsernameAndPassword("<username>", "<password>");

TranslateOptions translateOptions = new TranslateOptions.Builder()
  .addText("hello")
  .source(Language.ENGLISH)
  .target(Language.SPANISH)
  .build();
TranslationResult translationResult = service.translate(translateOptions).execute();

System.out.println(translationResult);
X Tutup