/** * Check if a message key is defined. * @param lang the message lang * @param key the message key * @return a Boolean */ public static Boolean isDefined(Lang lang, String key) { return getMessagesApi().isDefinedAt(lang, key); }
/** * Translates a message. * * Uses `java.text.MessageFormat` internally to format the message. * * @param lang the message lang * @param key the message key * @param args the message arguments * @return the formatted message or a default rendering if the key wasn't defined */ public static String get(Lang lang, String key, Object... args) { return getMessagesApi().get(lang, key, args); }
/** * Translates the first defined message. * * Uses `java.text.MessageFormat` internally to format the message. * * @param lang the message lang * @param keys the messages keys * @param args the message arguments * @return the formatted message or a default rendering if the key wasn't defined */ public static String get(Lang lang, List<String> keys, Object... args) { return getMessagesApi().get(lang, keys, args); }
/** * Translates a message. * * Uses `java.text.MessageFormat` internally to format the message. * * @param key the message key * @param args the message arguments * @return the formatted message or a default rendering if the key wasn't defined */ public static String get(String key, Object... args) { return getMessagesApi().get(getLang(), key, args); }
/** * Translates the first defined message. * * Uses `java.text.MessageFormat` internally to format the message. * * @param keys the messages keys * @param args the message arguments * @return the formatted message or a default rendering if the key wasn't defined */ public static String get(List<String> keys, Object... args) { return getMessagesApi().get(getLang(), keys, args); }
/** * Check if a message key is defined. * @param key the message key * @return a Boolean */ public static Boolean isDefined(String key) { return getMessagesApi().isDefinedAt(getLang(), key); }