Class WoolTranslator


  • public class WoolTranslator
    extends Object
    This class can translate WoolNodes given a translation map. The translation map can be obtained from a translation file using the WoolTranslationParser.
    • Constructor Detail

      • WoolTranslator

        public WoolTranslator​(Map<WoolTranslatable,​WoolTranslatable> translations)
        Constructs a new translator.
        Parameters:
        translations - the translation map
    • Method Detail

      • translate

        public WoolDialogue translate​(WoolDialogue dialogue)
        Translates the specified dialogue. This method creates a clone of the dialogue and then tries to fill in a translation for every translatable segment (plain text, variables and <<input>> commands).
        Parameters:
        dialogue - the dialogue
        Returns:
        the translated dialogue
      • translate

        public WoolNode translate​(WoolNode node)
        Translates the specified node. This method creates a clone of the node and then tries to fill in a translation for every translatable segment (plain text, variables and <<input>> commands).
        Parameters:
        node - the node
        Returns:
        the translated node