Package com.google.javascript.jscomp
Class ReplaceMessages
- java.lang.Object
-
- com.google.javascript.jscomp.ReplaceMessages
-
@GwtIncompatible("JsMessage") public final class ReplaceMessages extends java.lang.ObjectReplaceMessages replaces user-visible messages with alternatives. It uses Google specific JsMessageVisitor implementation.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classReplaceMessages.ProtectedJsMessageHolds information about the protected form of a translatable message that appears in the AST.
-
Field Summary
Fields Modifier and Type Field Description static DiagnosticTypeBUNDLE_DOES_NOT_HAVE_THE_MESSAGEstatic java.lang.StringDEFINE_MSG_CALLEE`goog.getMsg()` calls will be converted into a call to this method which is defined in synthetic externs.static java.lang.StringFALLBACK_MSG_CALLEE`goog.getMsgWithFallback(MSG_NEW, MSG_OLD)` will be converted into a call to this method which is defined in * synthetic externs.static DiagnosticTypeINVALID_ALTERNATE_MESSAGE_PLACEHOLDERS
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CompilerPassgetFullReplacementPass()When the returned pass is executed, the original `goog.getMsg()` etc.CompilerPassgetMsgProtectionPass()When the returned pass is executed, the original `goog.getMsg()` etc.CompilerPassgetReplacementCompletionPass()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.
-
-
-
Field Detail
-
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
-
DEFINE_MSG_CALLEE
public static final java.lang.String DEFINE_MSG_CALLEE
`goog.getMsg()` calls will be converted into a call to this method which is defined in synthetic externs.- See Also:
- Constant Field Values
-
FALLBACK_MSG_CALLEE
public static final java.lang.String FALLBACK_MSG_CALLEE
`goog.getMsgWithFallback(MSG_NEW, MSG_OLD)` will be converted into a call to this method which is defined in * synthetic externs.- See Also:
- Constant Field Values
-
-
Method Detail
-
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.
-
-