Contents
Class I18nModule
java.lang.Object
com.hypixel.hytale.server.core.plugin.PluginBase
com.hypixel.hytale.server.core.plugin.JavaPlugin
com.hypixel.hytale.server.core.modules.i18n.I18nModule
- All Implemented Interfaces:
CommandOwner
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Pathstatic final Stringstatic final Pathstatic final Stringstatic final Stringstatic final PluginManifeststatic final StringFields inherited from class PluginBase
METRICS_REGISTRY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic I18nModuleget()getMessage(String language, String key) getMessages(String language) getUpdatePacketsForChanges(String languageKey, Map<String, Map<String, String>> changed, Map<String, Map<String, String>> removed) voidqueueTranslations(PacketHandler packetHandler, String language) Queues the translation catalog of a language for a connection.resolveLanguage(String language) Resolves the given language identifier to one defined and recognized by the loaded message sets.voidsendTranslations(PacketHandler packetHandler, String language) Methods inherited from class JavaPlugin
getClassLoader, getFile, getTypeMethods inherited from class PluginBase
getAssetRegistry, getBasePermission, getChunkStoreRegistry, getClientFeatureRegistry, getCodecRegistry, getCodecRegistry, getCodecRegistry, getCommandRegistry, getDataDirectory, getEntityRegistry, getEntityStoreRegistry, getEventRegistry, getIdentifier, getLogger, getManifest, getName, getState, getTaskRegistry, isDisabled, isEnabled, preLoad
-
Field Details
-
MANIFEST
-
DEFAULT_LANGUAGE
- See Also:
-
FALLBACK_LANG_PATH
-
FILE_EXTENSION
- See Also:
-
SERVER_ASSETS
- See Also:
-
LANGUAGE_ASSETS
- See Also:
-
DEFAULT_GENERATED_PATH
-
-
Constructor Details
-
I18nModule
-
-
Method Details
-
get
-
getUpdatePacketsForChanges
-
getMessages
-
resolveLanguage
Resolves the given language identifier to one defined and recognized by the loaded message sets. If the language identifier is unrecognized, does not have a fallback, the fallback is unrecognized, or the identifier is null, the default language is used.- Parameters:
language- Language identifier- Returns:
- The nearest language identifier supported by the module.
-
getMessages
-
sendTranslations
-
queueTranslations
Queues the translation catalog of a language for a connection. The queued language replaces the one queued before it, and the flush task sends the last one. The flush task also drops the connections that closed, so an entry lives for one interval.- Parameters:
packetHandler- The connection to send the catalog to.language- The language to send the catalog for.
-
getMessage
-