Translation
import org.universaldevelopment.universalChat.API.UniversalChatAPI.makeTranslation
Translate message to specific language
Note: Use country codes for the Language argument
UniversalChatAPI.makeTranslation(Text, Language)
Text: String
Language: String
Returns String
Example
makeTranslation("Hello!", "de")
This example would change the string "Hello!" to German (de)
Async translation [RECOMMENDED]
import org.universaldevelopment.universalChat.API.UniversalChatAPI.makeTranslationAsync
Translate message to specific language
Note: Use country codes for the Language argument
UniversalChatAPI.makeTranslationAsync(Text, Language)
Text: String
Language: String
Returns String
Example
makeTranslationAsync("Hello, how are you?", "es") { translatedText ->
sender.sendMessage(translatedText)
}
This example would change the string "Hello, how are you?" to Spanish asynchronously
Last updated