Package com.google.javascript.jscomp
Class XtbMessageBundle
java.lang.Object
com.google.javascript.jscomp.XtbMessageBundle
- All Implemented Interfaces:
MessageBundle
A MessageBundle that parses messages from an XML Translation Bundle (XTB)
file.
-
Constructor Summary
ConstructorDescriptionXtbMessageBundle
(InputStream xtb, String projectId) Creates an instance and initializes it with the messages in an XTB file.XtbMessageBundle
(InputStream xtb, String projectId, boolean unused) -
Method Summary
Modifier and TypeMethodDescriptionReturns an iterable over the keys that this object has replacements for.getMessage
(String id) Gets a message replacement.Gets the message ID generator to use to compute message IDs for this type of bundle.
-
Constructor Details
-
XtbMessageBundle
-
XtbMessageBundle
Creates an instance and initializes it with the messages in an XTB file.- Parameters:
xtb
- the XTB file as a byte streamprojectId
- the translation console project id (i.e. name)
-
-
Method Details
-
getMessage
Description copied from interface:MessageBundle
Gets a message replacement.- Specified by:
getMessage
in interfaceMessageBundle
- Parameters:
id
- the id of the message being replaced; the key is message ID generated byJsMessage.IdGenerator
- Returns:
- the message replacement, which may be null.
-
idGenerator
Description copied from interface:MessageBundle
Gets the message ID generator to use to compute message IDs for this type of bundle.- Specified by:
idGenerator
in interfaceMessageBundle
- Returns:
- idGenerator instance or null if we do not want to use any custom id generation. In case if idGenerator is null caller should decide how to create id by itself. In the most cases using the message key is enough.
-
getAllMessages
Description copied from interface:MessageBundle
Returns an iterable over the keys that this object has replacements for.- Specified by:
getAllMessages
in interfaceMessageBundle
- Returns:
- all messages from this bundle.
-