title: What is the use of 'MessagesApi` in play framework
body: <p>I have seen code where <code>MessageApi</code> is injected in a controller but is not used.</p>
  
  <pre><code>class Application @Inject() (
    val messagesApi: MessagesApi, 
    val env:Environment[User,CookieAuthenticator],//change to JWT?
    socialProviderRegistry: SocialProviderRegistry) extends Silhouette[User,CookieAuthenticator] {
  
    //anyone could access the home page
    def index = UserAwareAction.async { implicit request =&gt;
      Future.successful(Ok(views.html.index(request.identity, request.authenticator.map(_.loginInfo))))
    }
  
    //only logged in users could access profile page.
    def profile = SecuredAction { implicit request =&gt;
      Ok(views.html.profile(request.identity, request.authenticator.loginInfo, socialProviderRegistry))
    }
  }
  </code></pre>
  
  <p>What is the purpose of <code>MessageApi</code>? I thought is was used in internationalization but then I saw another class <code>Message</code> which I have seen been used to get values of messages stored in different language files eg. messages.fr and being used as <code>Messages("index.logged")</code></p>