UNIVERSAL DEVELOPMENT
Join Discord [Click Here]
  • 🗨️UniversalChat
    • Installation
    • Commands
    • Permissions
    • Designing Your Chat
    • Customising Translation
    • Quick Chat (Shortcuts)
    • Server Guide
    • Profanity Filter
    • Message Of The Day (MOTD)
    • Polls
    • Autocorrect
    • Command Auto Complete
    • Developer Guide
      • Getting Started
      • Translation
      • Check For Profanity & Hate Speech
      • Create Summary Of Text
      • Server Guide
      • Autocorrect
      • Parsing Colors
    • Credits
  • 👜Modular Backpacks
    • Installation
    • Commands
    • Permissions
    • Changing backpack prices
Powered by GitBook
On this page
  • Translate message to specific language
  • Example
  • Async translation [RECOMMENDED]
  • Translate message to specific language
  • Example
  1. UniversalChat
  2. Developer Guide

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

PreviousGetting StartedNextCheck For Profanity & Hate Speech

Last updated 1 month ago

🗨️