6
votes

I would like to know if there is a way to use i18n with scala/playframework, this is what I have tried to do so far :

@()(

    implicit

    params:play.mvc.Scope.Params,

    flash:play.mvc.Scope.Flash,

    errors:Map[String,play.data.validation.Error]

)

@import play.i18n.Messages

@main(title = "The title") {

    <p>Hello world in &{'english'}</p>

}

I also tried with Message.get(...) instead of &{...} but it didn't help

1

1 Answers

12
votes

here is what I use:

@import play.i18n._

@main(title = "The title") {

   <p>Hello world in @Messages.get("english")</p>

}

Note the @ before the call to Messages.get("...").