我想将conf/messages
放入子文件夹,例如conf/lang/messages
。文档中没有任何内容:https://www.playframework.com/documentation/2.4.x/JavaI18N。
有人解决了这个问题吗?
答案 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
中读取消息文件。