/** * Get a messages context appropriate for the given candidates. * * Will select a language from the candidates, based on the languages available, and fallback to the default language * if none of the candidates are available. */ public Messages preferred(Http.RequestHeader request) { play.api.i18n.Messages msgs = messages.preferred(request); return new Messages(new Lang(msgs.lang()), this); }
/** * Get a messages context appropriate for the given request. * * Will select a language from the request, based on the languages available, and fallback to the default language * if none of the candidates are available. * * @param request the incoming request * @return the preferred messages context for the request */ public Messages preferred(Http.RequestHeader request) { play.api.i18n.Messages msgs = messages.preferred(request); return new MessagesImpl(new Lang(msgs.lang()), this); }
/** * Get a messages context appropriate for the given request. * * Will select a language from the request, based on the languages available, and fallback to the default language * if none of the candidates are available. * * @param request the incoming request * @return the preferred messages context for the request */ public Messages preferred(Http.RequestHeader request) { play.api.i18n.Messages msgs = messages.preferred(request); return new MessagesImpl(new Lang(msgs.lang()), this); }
/** * Get a messages context appropriate for the given request. * * Will select a language from the request, based on the languages available, and fallback to the default language * if none of the candidates are available. * * @param request the incoming request * @return the preferred messages context for the request */ public Messages preferred(Http.RequestHeader request) { play.api.i18n.Messages msgs = messages.preferred(request); return new MessagesImpl(new Lang(msgs.lang()), this); }
/** * Get a messages context appropriate for the given candidates. * * Will select a language from the candidates, based on the languages available, and fallback to the default language * if none of the candidates are available. * * @param candidates the candidate languages * @return the most appropriate Messages instance given the candidate languages */ public Messages preferred(Collection<Lang> candidates) { Seq<Lang> cs = Scala.asScala(candidates); play.api.i18n.Messages msgs = messages.preferred((Seq)cs); return new MessagesImpl(new Lang(msgs.lang()), this); }
/** * Get a messages context appropriate for the given candidates. * * Will select a language from the candidates, based on the languages available, and fallback to the default language * if none of the candidates are available. * * @param candidates the candidate languages * @return the most appropriate Messages instance given the candidate languages */ public Messages preferred(Collection<Lang> candidates) { Seq<Lang> cs = Scala.asScala(candidates); play.api.i18n.Messages msgs = messages.preferred((Seq)cs); return new MessagesImpl(new Lang(msgs.lang()), this); }
/** * Get a messages context appropriate for the given candidates. * * Will select a language from the candidates, based on the languages available, and fallback to the default language * if none of the candidates are available. * * @param candidates the candidate languages * @return the most appropriate Messages instance given the candidate languages */ public Messages preferred(Collection<Lang> candidates) { Seq<Lang> cs = Scala.asScala(candidates); play.api.i18n.Messages msgs = messages.preferred((Seq)cs); return new MessagesImpl(new Lang(msgs.lang()), this); }
/** * Get a messages context appropriate for the given candidates. * * Will select a language from the candidates, based on the languages available, and fallback to the default language * if none of the candidates are available. */ public Messages preferred(Collection<Lang> candidates) { Seq<Lang> cs = JavaConversions.collectionAsScalaIterable(candidates).toSeq(); play.api.i18n.Messages msgs = messages.preferred((Seq) cs); return new Messages(new Lang(msgs.lang()), this); }