Class EnhancedEchestTranslator

java.lang.Object
net.kyori.adventure.text.minimessage.translation.MiniMessageTranslator
com.enhancedechest.lang.EnhancedEchestTranslator
All Implemented Interfaces:
net.kyori.adventure.translation.Translator

public final class EnhancedEchestTranslator extends net.kyori.adventure.text.minimessage.translation.MiniMessageTranslator
Adventure Translator backing EnhancedEchest's per-viewer localization. It is registered once on the GlobalTranslator (see EnhancedEchestPlugin), so every Component the plugin sends — chat, inventory titles, dialogs, item names — is rendered against the recipient client's own locale at send time. That is why LanguageManager.get(java.lang.String, java.lang.String...) can keep returning a locale-free Component.translatable without threading a Locale through call sites.

It holds normalized MiniMessage strings keyed by translation key then Locale (see LanguageManager for how the raw YAML is normalized). Translation keys are namespaced (enhancedechest.msg.* / enhancedechest.gui.*) so they never collide with vanilla keys.

Lookup fallback for a requested locale: exact match → same language (any region) → the configured fallback locale (language: in config) → en_US (always bundled). When language-auto-detect is off the requested locale is ignored and the configured fallback is used for everyone — identical to the pre-feature single-locale behavior.

  • Constructor Details

    • EnhancedEchestTranslator

      public EnhancedEchestTranslator()
  • Method Details

    • name

      public net.kyori.adventure.key.Key name()
    • getMiniMessageString

      @Nullable protected @Nullable String getMiniMessageString(String key, Locale locale)
      Specified by:
      getMiniMessageString in class net.kyori.adventure.text.minimessage.translation.MiniMessageTranslator