Play framework, i18n “messages.*” in subfolders

不想你离开。 提交于 2020-06-17 06:59:32

问题


I want to put conf/messages into subfolder, like conf/lang/messages. There is nothing about this in documentation: https://www.playframework.com/documentation/2.4.x/JavaI18N.

Did someone resolve this problem ?


回答1:


This Messages.scala source code has a clue:

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

I have not tried it in 2.4 yet, but it looks worth taking for a spin.




回答2:


You can specify the sub-directory in application.conf by adding:

play.i18n.path = "lang"

Doing so will tell Play to read the messages files from conf/lang.



来源:https://stackoverflow.com/questions/33593310/play-framework-i18n-messages-in-subfolders

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!