Class LanguageConfig
java.lang.Object
dev.ua.theroer.magicutils.lang.LanguageConfig
@ConfigFile("lang/{lang}.{ext}")
@Comment("Language file for MagicUtils")
public class LanguageConfig
extends Object
Language configuration using the MagicUtils config system.
After load, a flat key -> value cache is built from all
configured sections so runtime getMessage(String) lookups are
plain Map.get calls and never touch reflection.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetMessage(String key) Resolves a message by key.voidputCustomMessage(String key, String value) Adds or updates a custom message entry.
-
Constructor Details
-
LanguageConfig
public LanguageConfig()Default constructor for LanguageConfig.
-
-
Method Details
-
putCustomMessage
-
getMessage
Resolves a message by key. Custom plugin messages take precedence over the built-in sectioned messages.Built-in keys follow the
magicutils.<section>.<field>pattern. The resolution uses a flat cache built lazily on first access so there is no reflection on the hot path.- Parameters:
key- message key- Returns:
- resolved value or
nullwhen no entry exists
-