This module allows you to split localization messages files into separate manageable files. Localized messages prefixed by file name. This allows for granular organization of localizations of large websites with lot of pages.
You can organize files in folder-per-language structure, containing multiple files:
\en
- users
- products
\fr
- users
- products
localization messages accessed by file. prefix.
File conf/en/users
contains:
greeting=Welcome!
You can then retrieve this message
Scala using the play.api.i18n.Messages object:
val title = Messages("users.greeting")
Java using play.i18n.Messages object:
String title = Messages.get("users.greeting")
The current 1.0 version is compatible only with Play 2.3
Add a dependency on the following artifact:
libraryDependencies += "com.github.germanosin" %% "play-foldermessages" % "1.0"
Add following line to application.conf
:
defaultmessagesplugin=disabled
foldermessagesplugin=enabled
German Osin