title: Implicit conversion not taking place for Play Framework Lang in controller
body: <p>I have a view that takes in an implicit <code>Lang</code>, needed for Play's <code>Messages</code> object. The signature of this view is:</p>
  
  <pre><code>@()(implicit lang: Lang)
  </code></pre>
  
  <p>Then I have a controller that needs to create the view:</p>
  
  <pre><code>def createView = Action { request =&gt;
    Ok(views.html.showView())
  }
  </code></pre>
  
  <p>And then I have an implicit method that I want called to create the <code>Lang</code> that the view needs:</p>
  
  <pre><code>implicit def getLangFromRequest(request: RequestHeader): Lang = {
    request.cookies.get("lang") match {
      case Some(cookie) =&gt; Lang(cookie.value)
      case None =&gt; Lang("en") // Default
    }
  }
  </code></pre>
  
  <p>In other words, the method is supposed to get the language from the cookie if it can or use a default otherwise (I've trimmed out error handling for this question).</p>
  
  <p>However, this implicit conversion isn't taking place. I know that it's able to implicitly convert, because by creating an implicit variable in the controller works:</p>
  
  <pre><code>def createView = Action { request =&gt;
    implicit val lang: Lang = request
    Ok(views.html.showView())
  }
  </code></pre>
  
  <p>But I'd rather not have to add this boiler plate line everywhere. Presumably I must explicitly call the method because there's some global <code>Lang</code> object that is being used before an implicit conversion.</p>
  
  <p>What are my options here to avoid having to repeat this <code>implicit val lang: Lang = request</code> in every controller?</p>