Package com.enhancedechest.lang
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected @Nullable StringgetMiniMessageString(String key, Locale locale) net.kyori.adventure.key.Keyname()Methods inherited from class net.kyori.adventure.text.minimessage.translation.MiniMessageTranslator
translate, translateMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.kyori.adventure.translation.Translator
canTranslate, hasAnyTranslations
-
Constructor Details
-
EnhancedEchestTranslator
public EnhancedEchestTranslator()
-
-
Method Details
-
name
public net.kyori.adventure.key.Key name() -
getMiniMessageString
- Specified by:
getMiniMessageStringin classnet.kyori.adventure.text.minimessage.translation.MiniMessageTranslator
-