withLang 的值不是 play.api.mvc.Result 的成员
value withLang is not a member of play.api.mvc.Result
在 Play Framework 2.3 应用程序中,我有以下方法:
def defaultLanguage[T](f: => Lang => Request[T] => Result)
(implicit request: Request[T]) = {
f(Lang(FRENCH))(request).withLang(Lang(FRENCH))
}
效果很好。现在我正在迁移到 2.4,我收到以下错误
value withLang is not a member of play.api.mvc.Result
我在迁移手册中没有看到任何关于此的内容,关于 2.4 中 withLang
的等价物有什么想法吗?
withLang
现在处于 ResultWithLang
. Mixin I18nSupport
以获得隐式转换:
class blabla with I18nSupport {
def defaultLanguage[T](f: => Lang => Request[T] => Result)
(implicit request: Request[T]) =
f(Lang(FRENCH))(request).withLang(Lang(FRENCH))
}
在 Play Framework 2.3 应用程序中,我有以下方法:
def defaultLanguage[T](f: => Lang => Request[T] => Result)
(implicit request: Request[T]) = {
f(Lang(FRENCH))(request).withLang(Lang(FRENCH))
}
效果很好。现在我正在迁移到 2.4,我收到以下错误
value withLang is not a member of play.api.mvc.Result
我在迁移手册中没有看到任何关于此的内容,关于 2.4 中 withLang
的等价物有什么想法吗?
withLang
现在处于 ResultWithLang
. Mixin I18nSupport
以获得隐式转换:
class blabla with I18nSupport {
def defaultLanguage[T](f: => Lang => Request[T] => Result)
(implicit request: Request[T]) =
f(Lang(FRENCH))(request).withLang(Lang(FRENCH))
}