Playframework: i18n + scala

I would like to know if there is a way to use i18n with scala / playframework, here is what I 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 using Message.get (...) instead of & {...}, but that didn't help

+6
source share
1 answer

here is what i use:

 @import play.i18n._ @main(title = "The title") { <p>Hello world in @Messages.get("english")</p> } 

Pay attention to @ before calling Messages.get ("...").

+12
source

Source: https://habr.com/ru/post/896108/


All Articles