/** * Get the message at the given key. * * 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 */ default String apply(String key, Object... args) { return at(key, args); }
/** * Get the message at the first defined key. * * 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 */ default String apply(List<String> keys, Object... args) { return at(keys, args); }
/** * Get the message at the first defined key. * * 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 */ default String apply(List<String> keys, Object... args) { return at(keys, args); }
/** * Get the message at the given key. * * 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 */ default String apply(String key, Object... args) { return at(key, args); }
/** * Get the message at the first defined key. * * 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 */ default String apply(List<String> keys, Object... args) { return at(keys, args); }
/** * Get the message at the given key. * * 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 */ default String apply(String key, Object... args) { return at(key, args); }
/** * Returns the formatted error message (message + arguments) in the given Messages. * * @param messagesObj the play.i18n.Messages object containing the language. * @return the results of messagesObj.at(messages, arguments). */ public String format(Messages messagesObj) { return messagesObj.at(messages, arguments); }
/** * Returns the formatted error message (message + arguments) in the given Messages. * * @param messagesObj the play.i18n.Messages object containing the language. * @return the results of messagesObj.at(messages, arguments). */ public String format(Messages messagesObj) { return messagesObj.at(messages, arguments); }
/** * Returns the formatted error message (message + arguments) in the given Messages. * * @param messagesObj the play.i18n.Messages object containing the language. * @return the results of messagesObj.at(messages, arguments). */ public String format(Messages messagesObj) { return messagesObj.at(messages, arguments); }
private ServerServiceCall<NotUsed, String> hello(String id, Messages messages) { return request -> { String hello = messages.at("hello.message", id); return CompletableFuture.completedFuture(hello); }; }