Package com.google.javascript.jscomp
Interface MessageBundle
- All Known Implementing Classes:
EmptyMessageBundle
,XtbMessageBundle
public interface MessageBundle
An interface for providing alternative values for user-visible messages in
JavaScript code.
-
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.
-
Method Details
-
idGenerator
JsMessage.IdGenerator idGenerator()Gets the message ID generator to use to compute message IDs for this type of bundle.- 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.
-
getMessage
Gets a message replacement.- 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.
-
getAllMessages
Returns an iterable over the keys that this object has replacements for.- Returns:
- all messages from this bundle.
-