Interface IMessageLocalizer
- All Superinterfaces:
Serializable
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
Interface for objects that can localize message keys in a given locale, optional with parameters.
- Author:
- XIMA MEDIA GmbH
-
Method Summary
-
Method Details
-
canLocalize
Checks if a message key can be localized in the given localThe default implementation invokes
localize(Locale, String, Object...)and checks if the result is not null and does not start or end with a question mark (which indicates a missing localization in our convention).- Parameters:
locale- The locale to check.messageKey- The message key to check.- Returns:
- True if the message key can be localized, false otherwise.
-
localize
Localizes a message key in the given locale.- Parameters:
locale- The locale to localize the message in.messageKey- The message key to localize.parameters- Optional parameters to replace in the message.- Returns:
- The localized message.
-