Class Translator


  • public class Translator
    extends java.lang.Object
    This class hold all methods for translation of an Engine. It list all text parts of an engine that can be translate and at runtime translates all parts which do not change the structure.
    Since:
    9.1
    • Constructor Summary

      Constructors 
      Constructor Description
      Translator​(Engine engine)
      Create a new translator for the given Engine.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.Set<java.lang.String> listLabels​(boolean useParagraph)
      Returns all strings that can be translated (i.e. labels, prompts and report title).
      void translate​(java.util.ResourceBundle languageResource, boolean useParagraph)
      Translate all labels and the report title of the engine.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Translator

        public Translator​(Engine engine)
        Create a new translator for the given Engine. This make only sence for the main Engine.
        Parameters:
        engine - the Engine, the instance must not be null and the instance must not have been executed and must hold a loaded report
        Since:
        9.1
    • Method Detail

      • listLabels

        public java.util.Set<java.lang.String> listLabels​(boolean useParagraph)
                                                   throws ReportException
        Returns all strings that can be translated (i.e. labels, prompts and report title). This can be used as input for a translation tool.
        Parameters:
        useParagraph - true, then a paragraph is translated in one step.
        Returns:
        a list, never null
        Throws:
        ReportException - if Engine is finished or no report is set.
        Since:
        9.1
        See Also:
        Translations.setUseParagraph(boolean)
      • translate

        public void translate​(java.util.ResourceBundle languageResource,
                              boolean useParagraph)
                       throws ReportException
        Translate all labels and the report title of the engine. This is used by the renderer itself if it has been enabled in the current configuration. If you use it at design time then it will change your design.
        Parameters:
        languageResource - the translation resource
        useParagraph - true, then a paragraph is translated in one step.
        Throws:
        ReportException - if Engine is finished or no report is set.
        Since:
        9.1
        See Also:
        Translations.setUseParagraph(boolean)