Message Catalog
To provide a localized experience, Admins and Vault Java SDK developers can
create translations for messages displayed to Vault end users. To do this,
they either add messages with MDL or use the
Message Catalog in Vault Help
After creating messages, developers use TranslationService to retrieve the
messages. Learn more in the Javadocs
Admins coordinate message translation into any Vault supported language using the
Bulk Translation tool in Vault Help
Add Messages via MDL
Section link for Add Messages via MDLCreate the custom Messagegroup with at least one Message using MDL.
For example, call the
Execute MDL Script endpoint
to add the message group and associated messages to Vault:
RECREATE Messagegroup person_validation__c (
label('Person Validation Messages'),
Message email_format__c(
default_value('${email_input} is not a valid email address.')
),
Message mobile_format__c(
default_value('${mobile_input} is not a valid mobile number.')
)
);In addition to conforming to the standard MDL rules, message groups and messages have additional restrictions:
- A
Messagegroupcontains a maximum of 500 messages. - All tokens used in a
Messagemust follow the format${token_name}, where "token_name" is a string starting with a letter and followed by zero or more letters and underscores.
Once the messages are added to Vault, they can be called by code. However, for
multiple languages to be supported, an Admin must translate the messages.
For untranslated messages, Vault displays the default_value from the MDL, in
Vault's base language
Translate Messages
Section link for Translate MessagesTranslate messages using the Field Labels option of the Bulk Translation
tool in the Vault UI. Learn more about
localizing messages in Vault Help
Messages can only be translated into
Vault supported languages
In the export CSV, messages have the message__sys Type. Their Key
follows the pattern Messagegroup#Message. For example:
person_validation__c#email_format__c.
Use Translated Messages in Java SDK Code
Section link for Use Translated Messages in Java SDK CodeAfter the translated messages are imported into Vault, use
TranslationService to add them to your custom code.
Learn more in the Javadocs
At runtime, users see messages in their preferred language. If no translation
exists,
Vault's base languagedefault_value, is used.
Label Sets
Section link for Label SetsIn addition to translating field labels, Vault allows Admins to create Label Sets to specify alternative Vault UI labels within a single language. This supports use cases where different groups of users within the same country or region may use different terminology to describe the same thing.
You can create Label Sets via MDL and upload field values via Vault API. Once created, you can use TranslationService to add them to your custom code. Learn more in the Javadocs