Package com.toxicrain.rainengine.core
Class LangHelper
java.lang.Object
com.toxicrain.rainengine.core.LangHelper
-
Constructor Summary
ConstructorsConstructorDescriptionLangHelper
(String baseName, Path directory, Locale locale) Constructs a LangHelper with external file support, locale selection, and auto-reload. -
Method Summary
Modifier and TypeMethodDescriptionvoid
changeLocale
(Locale locale) Changes the locale and reloads the properties file.Gets a property value by key.void
Stops the WatchService (optional if you want to clean up threads on shutdown).
-
Constructor Details
-
LangHelper
Constructs a LangHelper with external file support, locale selection, and auto-reload.- Parameters:
baseName
- The base name of the properties files (e.g., "lang").directory
- The directory containing the properties files.locale
- The starting locale.
-
-
Method Details
-
get
Gets a property value by key. -
changeLocale
Changes the locale and reloads the properties file. -
stopWatching
public void stopWatching()Stops the WatchService (optional if you want to clean up threads on shutdown).
-