Interface TranslationProvider


public interface TranslationProvider
Represents a class that provides translation services.
Since:
0.1.2.0
Author:
creatorfromhell
  • Method Summary

    Modifier and Type
    Method
    Description
    getLang(UUID identifier)
    Used to get the language of a player with the associated identifier.
    default String
    translate(UUID identifier, MessageData messageData)
    Used to translate a node for the given language for the given player.
    translateNode(MessageData messageData, String language)
    Used to translate a node for the given language.
  • Method Details

    • getLang

      String getLang(UUID identifier)
      Used to get the language of a player with the associated identifier.
      Parameters:
      identifier - The identifier of the player.
      Returns:
      The language that should be used for this player.
    • translateNode

      String translateNode(MessageData messageData, String language)
      Used to translate a node for the given language. This should resort to the default if the specified language doesn't exist.
      Parameters:
      messageData - The message data to utilize for this translation.
      language - The language to translate the node to.
      Returns:
      The translated message represented by the node, or the default for if the node doesn't exist.
    • translate

      default String translate(UUID identifier, MessageData messageData)
      Used to translate a node for the given language for the given player. This should resort to the default if the specified language doesn't exist.
      Parameters:
      identifier - The identifier of the given player.
      messageData - The message data to utilize for this translation.
      Returns:
      The translated message represented by the node, or the default for if the node doesn't exist.