Andriy Kuba
Andriy Kuba

Reputation: 8263

Play framework, i18n "messages.*" in subfolders

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 ?

Upvotes: 1

Views: 416

Answers (2)

cglotr
cglotr

Reputation: 916

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.

Upvotes: 1

wwkudu
wwkudu

Reputation: 2796

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.

Upvotes: 1

Related Questions