LanguageManager
class LanguageManager(plugin: JavaPlugin? = null, logger: Logger, selectedLanguage: Language, resourceLoader: (String) -> InputStream?? = null)(source)
Manages language files and provides message retrieval with string-based keys.
This class handles:
Loading language files from resources/languages/
Caching flattened language messages in memory
Providing message retrieval with placeholder substitution
Fallback to English if the selected language is unavailable
Constructors
Link copied to clipboard
constructor(plugin: JavaPlugin? = null, logger: Logger, selectedLanguage: Language, resourceLoader: (String) -> InputStream?? = null)
Functions
Link copied to clipboard
Link copied to clipboard
Gets the translated text for a toggle state (enabled/disabled).
Link copied to clipboard
Initializes the language manager by loading the languages getMessage can read: the selected one and the English fallback. Other bundled languages are never consulted, so parsing and flattening them at startup would be wasted work.