Interface TranslatetoModule
- All Superinterfaces:
org.incendo.cloud.execution.CommandExecutionHandler<FPlayer>, ModuleCommand, ModuleLocalization, ModuleSimple
The /translateto command, which translates a message into another language.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.incendo.cloud.execution.CommandExecutionHandler
org.incendo.cloud.execution.CommandExecutionHandler.FutureCommandExecutionHandler<C> -
Method Summary
Modifier and TypeMethodDescriptionconfig()The config section for this command, which also holds its aliases.googleTranslate(String source, String lang, String text) Translates text through Google, the fallback when no integration is configured.localization(FPlayer fPlayer) The localization section for a player, picked from their chosen language.The permission that gates this module.replaceLanguage(FPlayer fPlayer, String targetLang) The display name of a language in the reader's own language.Translates text using whichever translation integration is enabled.Methods inherited from interface org.incendo.cloud.execution.CommandExecutionHandler
executeFutureMethods inherited from interface ModuleCommand
execute, executeMethods inherited from interface ModuleLocalization
cooldown, cooldownOrThrow, permissions, sound, soundOrThrow
-
Method Details
-
config
Command.Translateto config()Description copied from interface:ModuleCommandThe config section for this command, which also holds its aliases.- Specified by:
configin interfaceModuleCommand- Specified by:
configin interfaceModuleSimple- Returns:
- the command settings
-
permission
Permission.Command.Translateto permission()Description copied from interface:ModuleSimpleThe permission that gates this module.- Specified by:
permissionin interfaceModuleSimple- Returns:
- the permission
-
localization
Description copied from interface:ModuleLocalizationThe localization section for a player, picked from their chosen language.- Specified by:
localizationin interfaceModuleLocalization- Parameters:
fPlayer- the player the text is for- Returns:
- the localization settings
-
replaceLanguage
-
translate
Translates text using whichever translation integration is enabled.- Parameters:
fPlayer- who askedsource- the language to translate from, or an empty string to detect ittarget- the language to translate intotext- the text- Returns:
- the translation, or the original text if no service could do it
-
googleTranslate
Translates text through Google, the fallback when no integration is configured.- Parameters:
source- the language to translate fromlang- the language to translate intotext- the text- Returns:
- the translation, or the original text on failure
-