Class Locales
java.lang.Object
net.william278.schematicupload.config.Locales
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic @NotNull StringescapeText(@NotNull String string) Escape a string fromMineDownformatting for use in a MineDown-formatted locale@NotNull de.themoep.minedown.adventure.MineDownReturns a MineDown-formatted stringOptional<de.themoep.minedown.adventure.MineDown>Returns a MineDown-formatted locale from the locales fileOptional<de.themoep.minedown.adventure.MineDown>Returns a MineDown-formatted locale from the locales file, with replacements appliedgetRawLocale(@NotNull String localeId) Returns a raw, unformatted locale loaded from the locales filegetRawLocale(@NotNull String localeId, @NotNull String... replacements) Returns a raw, unformatted locale loaded from the locales file, with replacements applied
-
Field Details
-
DEFAULT_LOCALE
- See Also:
-
-
Constructor Details
-
Locales
public Locales()
-
-
Method Details
-
getRawLocale
Returns a raw, unformatted locale loaded from the locales file- Parameters:
localeId- String identifier of the locale, corresponding to a key in the file- Returns:
- An
Optionalcontaining the locale corresponding to the id, if it exists
-
getRawLocale
public Optional<String> getRawLocale(@NotNull @NotNull String localeId, @NotNull @NotNull String... replacements) Returns a raw, unformatted locale loaded from the locales file, with replacements appliedNote that replacements will not be MineDown-escaped; use
escapeText(String)to escape replacements- Parameters:
localeId- String identifier of the locale, corresponding to a key in the filereplacements- Ordered array of replacement strings to fill in placeholders with- Returns:
- An
Optionalcontaining the replacement-applied locale corresponding to the id, if it exists
-
getLocale
public Optional<de.themoep.minedown.adventure.MineDown> getLocale(@NotNull @NotNull String localeId) Returns a MineDown-formatted locale from the locales file- Parameters:
localeId- String identifier of the locale, corresponding to a key in the file- Returns:
- An
Optionalcontaining the formatted locale corresponding to the id, if it exists
-
getLocale
public Optional<de.themoep.minedown.adventure.MineDown> getLocale(@NotNull @NotNull String localeId, @NotNull @NotNull String... replacements) Returns a MineDown-formatted locale from the locales file, with replacements appliedNote that replacements will be MineDown-escaped before application
- Parameters:
localeId- String identifier of the locale, corresponding to a key in the filereplacements- Ordered array of replacement strings to fill in placeholders with- Returns:
- An
Optionalcontaining the replacement-applied, formatted locale corresponding to the id, if it exists
-
format
@NotNull public @NotNull de.themoep.minedown.adventure.MineDown format(@NotNull @NotNull String text) Returns a MineDown-formatted string- Parameters:
text- The text to format- Returns:
- A
MineDownobject containing the formatted text
-
escapeText
Escape a string fromMineDownformatting for use in a MineDown-formatted locale- Parameters:
string- The string to escape- Returns:
- The escaped string
-