public final class LanguageTranslationManager extends Manager
It lets you discover language translation providers and ask them to translate a text.
| Modifier and Type | Method and Description |
|---|---|
List<LanguageSupport.Item> |
discoverLanguageSupport(rocks.xmpp.addr.Jid translationProvider)
Discovers language support for a translation provider.
|
Collection<Item> |
discoverTranslationProviders()
Discovers the language provider on the connected server.
|
List<LanguageTranslation.Translation> |
translate(rocks.xmpp.addr.Jid translationProvider,
String text,
String sourceLanguage,
String... destinationLanguage)
Translates a text by sending a query to a translation provider.
|
isEnabled, setEnabledpublic Collection<Item> discoverTranslationProviders() throws XmppException
StanzaException - If the entity returned a stanza error.NoResponseException - If the entity did not respond.XmppExceptionpublic List<LanguageSupport.Item> discoverLanguageSupport(rocks.xmpp.addr.Jid translationProvider) throws XmppException
translationProvider - The translation provider.StanzaException - If the entity returned a stanza error.NoResponseException - If the entity did not respond.XmppExceptionpublic List<LanguageTranslation.Translation> translate(rocks.xmpp.addr.Jid translationProvider, String text, String sourceLanguage, String... destinationLanguage) throws XmppException
translationProvider - The translation provider.text - The text to be translated.sourceLanguage - The source language.destinationLanguage - The destination language.StanzaException - If the entity returned a stanza error.NoResponseException - If the entity did not respond.XmppExceptionCopyright © 2014–2015 XMPP.rocks. All rights reserved.