Package com.google.javascript.jscomp
Class ReplaceMessages.ProtectedJsMessage
java.lang.Object
com.google.javascript.jscomp.ReplaceMessages.ProtectedJsMessage
- Enclosing class:
ReplaceMessages
Holds information about the protected form of a translatable message that appears in the AST.
The original translatable messages are replaced with this protected form by the logic in `ReplaceMessages` to protect the message information through the optimization passes.
// original
var MSG_GREETING = goog.getMsg('Hello, {$name}!', {name: person.getName()}, {html: false});
// protected form
var MSG_GREETING = __jscomp_define_msg__(
{
'key': 'MSG_GREETING',
'msg_text': 'Hello, {$name}!',
'escapeLessThan': ''
},
{'name': person.getName()});
-
Method Summary
Modifier and TypeMethodDescriptionstatic @Nullable ReplaceMessages.ProtectedJsMessage
fromAstNode
(Node node, JsMessage.IdGenerator idGenerator)
-
Method Details
-
fromAstNode
public static @Nullable ReplaceMessages.ProtectedJsMessage fromAstNode(Node node, JsMessage.IdGenerator idGenerator)
-