Class GUILanguageManager
java.lang.Object
me.eddie.inventoryguiapi.language.GUILanguageManager
Created by Edward on 28/12/2016.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetFormattedString(String key, Object... args) Get a formatted string.Get the locale this LanguageManager was initialized with and therefore should be used if possibleGet the resource bundle being used to determine which messages to displayConvenience method that calls to the resource bundlevoidinitResources(Locale locale) Initialize the resource bundle to use.
-
Field Details
-
BUNDLE_NAME
- See Also:
-
-
Constructor Details
-
GUILanguageManager
-
GUILanguageManager
public GUILanguageManager()
-
-
Method Details
-
initResources
Initialize the resource bundle to use. Will attempt to find the closest matching available for the given locale.- Parameters:
locale- The locale to attempt to match
-
getPreferredLocale
Get the locale this LanguageManager was initialized with and therefore should be used if possible- Returns:
- The Locale
-
getResources
Get the resource bundle being used to determine which messages to display- Returns:
- The currently used resource bundle
-
getString
Convenience method that calls to the resource bundle- Parameters:
key- The key to get the value of in the resource bundle- Returns:
- The value matching the specified key
-
getFormattedString
Get a formatted string. This will get a java-style string to format (Same as used for printf) from the resource bundle and then will format it with the given arguments.- Parameters:
key- The key of the string in the resource bundleargs- The arguments to use to format the string- Returns:
- The formatted string
-