/** * Returns a new result with the given lang set in a cookie. For example: * * <pre> * {@code * public Result action() { * ok("Hello").withLang(Lang.forCode("es"), messagesApi); * } * } * </pre> * * Where {@code messagesApi} were injected. * * @param lang the new lang * @param messagesApi the messages api implementation * @return a new result with the given lang. * * @see MessagesApi#setLang(Result, Lang) */ public Result withLang(Lang lang, MessagesApi messagesApi) { return messagesApi.setLang(this, lang); }
/** * Returns a new result with the given lang set in a cookie. For example: * * <pre> * {@code * public Result action() { * ok("Hello").withLang(Lang.forCode("es"), messagesApi); * } * } * </pre> * * Where {@code messagesApi} were injected. * * @param lang the new lang * @param messagesApi the messages api implementation * @return a new result with the given lang. * * @see MessagesApi#setLang(Result, Lang) */ public Result withLang(Lang lang, MessagesApi messagesApi) { return messagesApi.setLang(this, lang); }
/** * Returns a new result with the given lang set in a cookie. For example: * * <pre> * {@code * public Result action() { * ok("Hello").withLang(Lang.forCode("es"), messagesApi); * } * } * </pre> * * Where {@code messagesApi} were injected. * * @param lang the new lang * @param messagesApi the messages api implementation * @return a new result with the given lang. * * @see MessagesApi#setLang(Result, Lang) */ public Result withLang(Lang lang, MessagesApi messagesApi) { return messagesApi.setLang(this, lang); }