As I need that Play application should load and read a single message file, I was thinking of calling loadMessages() method of MessagesPlugin class of Scala from my Application class of Java and pass the path of single message file. I am assuming that when my application will boot , it will call loadMessages() method of Scala and create map of single message file. Kindly rectify if my understanding is wrong.
As I am totally new to Scala programming , kindly rectify me If I am calling Scala method in Java class in wrong way:
import play.api.i18n.MessagesPlugin;
class Application{
private static boolean renderHomePage(){
language="en";
String configPath=System.getProperty("IUI_CONFIG_DIR");
MessagesPlugin.loadMessages(configPath+"/"+language+"/messages."+language);
changeLang(language);
setSessionData(true);
return true;
}
}
But my above code is unable to recognize loadMessages(). Do I need to import something else.