Language Translator v3 is now available. The v2 Language Translator API will no longer be available after July 31, 2018. To take advantage of the latest service enhancements, migrate to the v3 API. View the Migrating to Language Translator v3 page for more information.
Language Translator translates text from one language to another. The service offers multiple domain-specific models that you can customize based on your unique terminology and language. Use Language Translator to take news from across the globe and present it in your language, communicate with your customers in their own language, and more.
PM > Install-Package IBM.WatsonDeveloperCloud.LanguageTranslator.v2
<ItemGroup>
<PackageReference Include="IBM.WatsonDeveloperCloud.LanguageTranslator.v2" Version="2.5.0" />
</ItemGroup>
Select a domain, then identify or select the language of text, and then translate the text from one supported language to another.
Translates input text from the source language to the target language.
// Translate '"Hello! How are you?' from English to Portuguese using the Language Translator service
var results = _languageTranslator.Translate("en", "pt", "Hello! How are you?");
Return the list of languages it can detect.
// returns a list of identifiable languages
var result = _languageTranslator.GetIdentifiableLanguages();
Identify the language in which a text is written.
// identifies the language of a body of text.
var result = _languageTranslator.Identify("<text-to-identify>");
Lists available models for language translation with option to filter by source or by target language.
// lists all language models
var result = _languageTranslator.ListModels();
Deletes trained translation models.
// deletes a custom languge model
var result = _languageTranslator.DeleteModel("<custom-model-id>");
Returns information, including training status, about a specified translation model.
// gets details of a particular model
var result = _languageTranslator.GetModelDetails("<model-id>");