Class I18n.Utf8LangFileControl

java.lang.Object
java.util.ResourceBundle.Control
dev.satyrn.papermc.api.lang.v1.I18n.Utf8LangFileControl
Enclosing class:
I18n

public static class I18n.Utf8LangFileControl extends ResourceBundle.Control
Gathers a UTF-8 *.lang file into a resource bundle.
Since:
1.1.0
  • Constructor Details

    • Utf8LangFileControl

      public Utf8LangFileControl()
  • Method Details

    • newBundle

      @Nullable public @Nullable ResourceBundle newBundle(@NotNull @NotNull String baseName, @NotNull @NotNull Locale locale, @Nullable @Nullable String format, @NotNull @NotNull ClassLoader classLoader, boolean reload) throws IOException
      Creates a new bundle from the *.lang file.
      Overrides:
      newBundle in class ResourceBundle.Control
      Parameters:
      baseName - The base name of the file.
      locale - The locale to use.
      format - The file format. Unused.
      classLoader - The java class loader instance.
      reload - Whether the stream should be reloaded or the cached class loader stream should be used.
      Returns:
      A new ResourceBundle from the language file.
      Throws:
      IOException - Occurs when the bundle file cannot be located or read.
      Since:
      1.1.0
    • toBundleName

      @NotNull public @NotNull String toBundleName(@NotNull @NotNull String baseName, @NotNull @NotNull Locale locale)
      Gets the bundle name of this resource.
      Overrides:
      toBundleName in class ResourceBundle.Control
      Parameters:
      baseName - The fallback resource name if the locale does not have a language code.
      locale - The locale.
      Returns:
      The locale's language and country code separated by an underscore, or, if the locale lacks a language code, returns the base name.
      Since:
      1.1.0