You are on the right track by placing messages in the properties file. Java makes this pretty easy if you use a ResourceBundle . Basically, you create a properties file containing message lines for each locale that you want to support ( messages_en.properties , messages_ja.properties ), and merge these properties files into your jar. Then in your code you retrieve the message:
ResourceBundle bundle = ResourceBundle.getBundle("messages"); String text = MessageFormat.format(bundle.getString("ERROR_MESSAGE"), args);
When you download the package, Java will determine which language you are using and download the correct message. Then you pass your arguments along with the message string and create a localized message.
Link for ResourceBundle .
source share