Monday, June 16, 2008

To access MessageBundle.properties in java

We can access MessageBundle.properties in java as below:

for e.g. you have MessagesBundle_en.properties file undera /config directory in the project

Access it as below:
String messages = java.util.ResourceBundle.getBundle("config/MessagesBundle_" + language);
String text = messages.getString("confEmail.yourUserID")

No comments: