Interface BedWars.LanguageUtil

Enclosing interface:
BedWars

public static interface BedWars.LanguageUtil
  • Method Summary

    Modifier and Type Method Description
    boolean addLanguage​(Language language)
    Add a language to the list.
    Language getDefaultLanguage()
    Get server default language.
    Language getLang​(java.lang.String iso)
    Get a language by iso code.
    java.util.List<Language> getLanguages()
    Get installed language list.
    java.util.List<java.lang.String> getList​(org.bukkit.entity.Player p, java.lang.String path)
    Get a string list in player's language.
    java.lang.String getMsg​(org.bukkit.entity.Player p, java.lang.String path)
    Get message in player's language.
    Language getPlayerLanguage​(org.bukkit.entity.Player p)
    Retrieve a player language.
    boolean isLanguageExist​(java.lang.String iso)
    Check if a language is loaded.
    void saveIfNotExists​(java.lang.String path, java.lang.Object data)
    Save default data if not exists in the language files.
    void setDefaultLanguage​(Language defaultLanguage)
    Change server default language.
  • Method Details

    • saveIfNotExists

      void saveIfNotExists​(java.lang.String path, java.lang.Object data)
      Save default data if not exists in the language files. Save a default message on all languages files.
      Parameters:
      path - message path.
      data - message value.
    • getLanguages

      java.util.List<Language> getLanguages()
      Get installed language list.
      Returns:
      available languages list.
    • getMsg

      java.lang.String getMsg​(org.bukkit.entity.Player p, java.lang.String path)
      Get message in player's language.
      Parameters:
      p - target player.
      path - message path.
      Returns:
      color translated message.
    • getPlayerLanguage

      Language getPlayerLanguage​(org.bukkit.entity.Player p)
      Retrieve a player language.
      Parameters:
      p - target player.
      Returns:
      player language.
    • getList

      java.util.List<java.lang.String> getList​(org.bukkit.entity.Player p, java.lang.String path)
      Get a string list in player's language.
      Parameters:
      p - target player.
      path - list path.
      Returns:
      translated list with translated colors.
    • isLanguageExist

      boolean isLanguageExist​(java.lang.String iso)
      Check if a language is loaded. Iso example: en, ro etc.
      Parameters:
      iso - language iso code.
      Returns:
      true if the language is loaded.
    • addLanguage

      boolean addLanguage​(Language language)
      Add a language to the list.
      Parameters:
      language - new language.
      Returns:
      true if the language was added successfully.
    • getLang

      @Nullable Language getLang​(java.lang.String iso)
      Get a language by iso code.
      Parameters:
      iso - language code. Ex: ro, en.
      Returns:
      NULL if not found.
    • setDefaultLanguage

      void setDefaultLanguage​(Language defaultLanguage)
      Change server default language.
      Parameters:
      defaultLanguage - language.
    • getDefaultLanguage

      Language getDefaultLanguage()
      Get server default language.
      Returns:
      server default language.