Class I18N
java.lang.Object
org.episteme.core.ui.i18n.I18N
Internationalization helper for Episteme UI.
Manages multiple resource bundles and provides centralized access to localized strings. Supports dynamic locale switching.
- Since:
- 1.0
- Author:
- Silvere Martin-Michiellot, Gemini AI (Google DeepMind)
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classCustom ResourceBundle.Control to enforce UTF-8 encoding. -
Method Summary
Modifier and TypeMethodDescriptionvoidRegisters an additional resource bundle base name.voidaddListener(Consumer<Locale> listener) Retrieves a localized string for the given key.Retrieves a localized string with format arguments.Retrieves a localized string for the given key, returning the default value if not found.static I18NLocale[]Gets the current locale.booleanvoidremoveListener(Consumer<Locale> listener) voidSets the current locale and reloads all bundles.static voidsetTestMode(boolean enabled) voidToggles between English and French.
-
Method Details
-
getInstance
-
addBundle
Registers an additional resource bundle base name.- Parameters:
bundleBase- the bundle base name (e.g., "org.episteme.core.ui.i18n.messages_natural")
-
setLocale
Sets the current locale and reloads all bundles.- Parameters:
locale- the new locale
-
addListener
-
removeListener
-
getSupportedLocales
-
getLocale
-
toggleLanguage
public void toggleLanguage()Toggles between English and French. -
get
-
get
-
hasKey
-
get
-
setTestMode
public static void setTestMode(boolean enabled)
-