Package com.prowidesoftware
Class ProwideLocale
- java.lang.Object
-
- com.prowidesoftware.ProwideLocale
-
public final class ProwideLocale extends java.lang.Object
Helper class to manage default supported locales- Since:
- 7.7
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String[]
SUPPORTED_LANGS
-
Constructor Summary
Constructors Constructor Description ProwideLocale()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.util.ResourceBundle
getBundle(java.lang.Class<?> clazz)
Safe get locale, checking if current locale is supported Same asgetBundle(clazz, Locale.getDefault()))
static java.util.ResourceBundle
getBundle(java.lang.Class<?> clazz, java.util.Locale locale)
Get requested bundle or ENGLISH if missing resource for the given locale.static java.util.ResourceBundle
getBundle(java.lang.String resource)
Safe get locale, checking if current locale is supported Same asgetBundle(resource, Locale.getDefault()))
static java.util.ResourceBundle
getBundle(java.lang.String resource, java.util.Locale locale)
Get requested bundle or ENGLISH if missing resource for the given locale.
-
-
-
Method Detail
-
getBundle
public static java.util.ResourceBundle getBundle(java.lang.Class<?> clazz, java.util.Locale locale)
Get requested bundle or ENGLISH if missing resource for the given locale. Uses the calss FQN (with package) for the resource location.- Parameters:
clazz
- the class for which the resource bundle is loadedlocale
- a locale- Returns:
- the bundle for the given class and locale or English if not found.
- Since:
- 7.7
-
getBundle
public static java.util.ResourceBundle getBundle(java.lang.Class<?> clazz)
Safe get locale, checking if current locale is supported Same asgetBundle(clazz, Locale.getDefault()))
- Parameters:
clazz
- class object for lookup of the resource bundle- Returns:
- resource bundle
- Since:
- 7.7
- See Also:
getBundle(Class, Locale)
-
getBundle
public static java.util.ResourceBundle getBundle(java.lang.String resource, java.util.Locale locale)
Get requested bundle or ENGLISH if missing resource for the given locale.- Parameters:
resource
- the name of the resource bundle to loadedlocale
- a locale- Returns:
- the bundle for the given resource name and locale or English if not found.
- Since:
- 7.9.7
-
getBundle
public static java.util.ResourceBundle getBundle(java.lang.String resource)
Safe get locale, checking if current locale is supported Same asgetBundle(resource, Locale.getDefault()))
- Parameters:
resource
- name of the resource bundle, a fully qualified class name- Returns:
- resource bundle
- Since:
- 7.9.7
- See Also:
getBundle(String, Locale)
-
-