Class LocaleHelper
java.lang.Object
de.redstoneworld.redutilities.misc.LocaleHelper
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
LocaleHelper
public LocaleHelper()
-
-
Method Details
-
getLocale
This method converts a locale string (e.g., "de", "de_DE", "en-US", "fr_CA_POSIX") into a Java 'Locale' object. Supports both underscore "_" and hyphen "-" as separators. Examples:- "de" -> new Locale("de")
- "de_DE" -> new Locale("de", "DE")
- "en-US" -> new Locale("en", "US")
- "fr_CA_POSIX" -> new Locale("fr", "CA", "POSIX")
- Parameters:
localeStr- the locale string to parse- Returns:
- the corresponding Locale object
-