public final class GoogleJsMessageIdGenerator extends Object implements JsMessage.IdGenerator
JsMessage.IdGenerator
designed to play nicely with Google's Translation
systems. Each message is scoped to a project id, so that it does
not conflict with other messages at Google.
Just as reminder what key type used in different formats:
Constructor and Description |
---|
GoogleJsMessageIdGenerator(String projectId)
Creates an instance.
|
Modifier and Type | Method and Description |
---|---|
String |
generateId(String meaning,
List<CharSequence> messageParts)
Generate the ID for the message.
|
public GoogleJsMessageIdGenerator(String projectId)
projectId
- A TC project name (e.g. "MyProject")public String generateId(String meaning, List<CharSequence> messageParts)
JsMessage.IdGenerator
generateId
in interface JsMessage.IdGenerator
meaning
- The programmer-specified meaning. If no @meaning
annotation appears, we will use the name of the variable it's
assigned to. If the variable is unnamed, then we will just
use a fingerprint of the message.messageParts
- The parts of the message, including the main
message text.Copyright © 2009-2017 Google. All Rights Reserved.