Class LocalizationUtil
java.lang.Object
nl.pim16aap2.animatedarchitecture.core.localization.LocalizationUtil
Represents a utility class with methods that can be used for the localization system.
-
Method Summary
Modifier and TypeMethodDescriptiongetLocaleFilesInJar(Path jarFile) Gets the names of all locale files in a jar.static @Nullable LocaleparseLocale(@Nullable String locale) Parses aLocalefrom a String representing a locale.
-
Method Details
-
getLocaleFilesInJar
Gets the names of all locale files in a jar.The name of each locale file is the name of the file itself, with optional relative path.
- Parameters:
jarFile- The jar file to search in.- Returns:
- The names of all locale files in the jar.
- Throws:
IOException- If an I/O error occurs.
-
parseLocale
Parses aLocalefrom a String representing a locale. E.g. "en_US".When the provided locale is null or blank,
Locale.ROOTis returned.- Parameters:
locale- A String representing a locale.- Returns:
- The parse Locale.
-