Class ReplaceMessages

java.lang.Object
com.google.javascript.jscomp.ReplaceMessages

public final class ReplaceMessages extends Object
ReplaceMessages replaces user-visible messages with alternatives. It uses Google specific JsMessageVisitor implementation.
  • Field Details

    • BUNDLE_DOES_NOT_HAVE_THE_MESSAGE

      public static final DiagnosticType BUNDLE_DOES_NOT_HAVE_THE_MESSAGE
    • INVALID_ALTERNATE_MESSAGE_PLACEHOLDERS

      public static final DiagnosticType INVALID_ALTERNATE_MESSAGE_PLACEHOLDERS
  • Method Details

    • getMsgProtectionPass

      public CompilerPass getMsgProtectionPass()
      When the returned pass is executed, the original `goog.getMsg()` etc. calls will be replaced with a form that will survive unchanged through optimizations unless eliminated as unused.

      After all optimizations are complete, the pass returned by `getReplacementCompletionPass()`.

    • getReplacementCompletionPass

      public CompilerPass getReplacementCompletionPass()
      When the returned pass is executed, the protected messages created by `getMsgProtectionPass()` will be replaced by the final message form read from the appropriate message bundle.
    • getFullReplacementPass

      public CompilerPass getFullReplacementPass()
      When the returned pass is executed, the original `goog.getMsg()` etc. calls will all be replaced with the final message form read from the message bundle.

      This is the original way of running this pass as a single operation.