Reputation:
In a Play Framework 2.3 app, I had the following method:
def defaultLanguage[T](f: => Lang => Request[T] => Result)
(implicit request: Request[T]) = {
f(Lang(FRENCH))(request).withLang(Lang(FRENCH))
}
Worked great. Now that I am migrating to 2.4, I get the following error
value withLang is not a member of play.api.mvc.Result
I don't see anything about this in the migration manual, any idea on the equivalent of withLang
in 2.4?
Upvotes: 0
Views: 471
Reputation:
withLang
is now in ResultWithLang
. Mixin I18nSupport
to get an implicit conversion:
class blabla with I18nSupport {
def defaultLanguage[T](f: => Lang => Request[T] => Result)
(implicit request: Request[T]) =
f(Lang(FRENCH))(request).withLang(Lang(FRENCH))
}
Upvotes: 1