在子文件夹中播放框架,i18n“messages。*”

时间:2015-11-08 11:14:41

标签: playframework playframework-2.4

我想将conf/messages放入子文件夹,例如conf/lang/messages。文档中没有任何内容:https://www.playframework.com/documentation/2.4.x/JavaI18N

有人解决了这个问题吗?

2 个答案:

答案 0 :(得分:1)

这个Messages.scala source code有一个线索:

protected val messagesPrefix =
  config.getDeprecated[Option[String]]("play.i18n.path", "messages.path")

我还没有在2.4中尝试过,但看起来值得一试。

答案 1 :(得分:1)

您可以通过添加以下内容来指定application.conf中的子目录:

play.i18n.path = "lang"

这样做将告诉Play从conf/lang中读取消息文件。