http://www.playframework.com/documentation/2.3.x/JavaI18N
conf/application.conf
# The application languages # ~~~~~ application.langs="ja,en"
conf/messages
このファイルがデフォルトで読み込まれるようです。
comment=コメントです
conf/messages.ja
comment=コメントです
app/views/index.scala.html
@(message: String)
@import play.i18n._
@main(Messages.get("home.title")) {
<h1>@message</h1>
@Messages.get("comment")
}のようにすると、
@Messages.get(“comment”)部分が日本語で表示されるようになります。
@mainに渡す場合は
@Messages.get(“home.title”)
ではなく、
Messages.get(“home.title”)
と書きます。
メソッド内で使う場合は
app/controllers/Application.java
import play.i18n.Messages;
public class Application extends Controller {
public static Result index() {
return ok(index.render(Messages.get("top.title")));
}
}のようになります。
conf/messages.en
を用意した場合、
home.title=
のように書いておかないとパースエラーで怒られます。


