Package dev.orne.i18n
Class I18N
java.lang.Object
dev.orne.i18n.I18N
Main entry point to I18N framework. Provides methods for configuration and
manipulation of I18N contexts.
- Since:
- 0.1
- Version:
- 1.0, 2021-01
- Author:
- (w) Iker Hernaez
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionstatic @NotNull Locale[]
Returns the languages supported by the application.static @NotNull Locale
Returns the current locale.static @NotNull I18nResources
Returns the default I18N resources of the application.static @NotNull I18nResources
getResources
(String key) Returns the I18N resources identified by the specified key.static void
Sets the current locale.
-
Method Details
-
getAvailableLocales
Returns the languages supported by the application.Shortcut for
I18nContext.getInstance().getAvailableLocales()
.- Returns:
- The languages supported by the application
- See Also:
-
getResources
Returns the default I18N resources of the application.Shortcut for
I18nContext.getInstance().getI18nResources()
.- Returns:
- The default I18N resources
- See Also:
-
getResources
Returns the I18N resources identified by the specified key. If key isnull
or no resources is associated for such key returns the default I18N resources.Shortcut for
I18nContext.getInstance().getI18nResources(key)
.- Parameters:
key
- The key of the alternative I18N resources- Returns:
- The I18N resources to use for the key
- See Also:
-
getLocale
Returns the current locale.- Returns:
- The current locale
-
setLocale
Sets the current locale.- Parameters:
locale
- The current locale
-