java.lang.Object
io.github.thebusybiscuit.slimefun4.core.services.localization.Language

public final class Language extends Object
This Class represents a Language that Slimefun can recognize and use.
Author:
TheBusyBiscuit
See Also:
  • Constructor Details

    • Language

      public Language(@Nonnull String id, @Nonnull String hash)
      This instantiates a new Language with the given language code and skull texture.
      Parameters:
      id - The language code of this Language
      hash - The hash of the skull texture to use
  • Method Details

    • getId

      @Nonnull public String getId()
      This returns the identifier of this Language.
      Returns:
      The identifier of this Language
    • getTranslationProgress

      public double getTranslationProgress()
      This method returns the progress of translation for this Language. The progress is determined by the amount of translated strings divided by the amount of strings in the english Language file and multiplied by 100.0
      Returns:
      A percentage (0.0 - 100.0) for the progress of translation of this Language
    • setFile

      public void setFile(@Nonnull LanguageFile file, @Nonnull FileConfiguration config)
    • getItem

      @Nonnull public ItemStack getItem()
      This method returns the ItemStack that is used to display this Language in the SlimefunGuide.
      Returns:
      The ItemStack used to display this Language
    • getName

      @Nonnull public String getName(@Nonnull Player p)
      This method localizes the name of this Language in the selected Language of the given Player.
      Parameters:
      p - The Player to localize the name for
      Returns:
      The localized name of this Language
    • isDefault

      public boolean isDefault()
      This method returns whether this Language is also the default Language of this Server.
      Returns:
      Whether this is the default Language of this Server
    • toString

      public String toString()
      Overrides:
      toString in class Object