We have a site which will be used for two different clients. During first request the user will be asked to choose a client. Based on that text,labels and site content should be displayed.
Is it possible to have two messages file in Play framework and during session startup the messages file would be decided
As of my research we can have more than a file for each Locale, the messages will be get based on locale in the request.
Solved this problem with below solution,
MessagesPlugInwhich extendsplay.i18n.MessagesPluginMessagesas likeplay.i18n.MessagesmessaagesByClientIDinMessages.javaonApplicationStart()inMessagesPlugInmessaagesByClientIDaslocalesloaded inplay.i18n.MessagesPluginget()inMessages.java, retrieve the property frommessaagesByClientIDbased ClientId in the session. If the property is not available callget()inplay.i18n.Messages7.Created a Custom tag
il8nTagand its used in HTML templates.il8nTagwill invoke the methos inMessages.get().