java.lang.Object
org.snapfx.localization.internal.DockLocalizationService
Internal localization service with provider fallback and message formatting.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionCreates a localization service using SnapFX built-in resource bundles.DockLocalizationService(DockLocalizationProvider builtInProvider) Creates a localization service with an explicit built-in provider. -
Method Summary
Modifier and TypeMethodDescriptionReturns the active locale.Returns the optional user provider.voidSets the active locale.voidsetUserProvider(DockLocalizationProvider userProvider) Sets the optional user provider.Resolves and formats a localized message.
-
Field Details
-
DEFAULT_LOCALE
Default SnapFX locale used when no explicit locale is configured. -
BUILT_IN_LOCALES
Locales for which SnapFX ships built-in translations. -
BUILT_IN_BUNDLE_BASE_NAME
Base bundle name for built-in SnapFX translations.- See Also:
-
-
Constructor Details
-
DockLocalizationService
public DockLocalizationService()Creates a localization service using SnapFX built-in resource bundles. -
DockLocalizationService
Creates a localization service with an explicit built-in provider.- Parameters:
builtInProvider- built-in provider used as framework fallback
-
-
Method Details
-
getLocale
Returns the active locale.- Returns:
- active locale
-
setLocale
Sets the active locale.- Parameters:
locale- new locale;nullfalls back toDEFAULT_LOCALE
-
getUserProvider
Returns the optional user provider.- Returns:
- user provider, or
null
-
setUserProvider
Sets the optional user provider.- Parameters:
userProvider- user provider, ornull
-
text
Resolves and formats a localized message.- Parameters:
key- translation keyargs- optional message-format arguments- Returns:
- resolved localized text
-