【问题标题】:playframework : i18n + scala游戏框架:i18n + scala
【发布时间】:2011-08-29 17:29:07
【问题描述】:

我想知道是否有办法将 i18n 与 scala/playframework 一起使用,这是我迄今为止尝试做的:

@()(

    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>

}

我也尝试使用 Message.get(...) 而不是 &{...} 但没有帮助

【问题讨论】:

    标签: templates scala internationalization playframework


    【解决方案1】:

    这是我使用的:

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

    注意调用 Messages.get("...") 之前的 @。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2011-11-09
      • 2019-04-14
      • 1970-01-01
      • 2011-01-17
      • 2012-04-01
      • 1970-01-01
      • 2011-04-28
      • 2013-12-29
      相关资源
      最近更新 更多