I’ve multiple messages file (messages_en.properties, messages_ch.properties)
These files are having some static html text & need some dynamic input param such as username so that it’ll say Dear {0}, thanks for subscription....
Now i need to substitute username there after reading those contents from appropriate file.
How can I do that in Java? Is there any framework sample code available?
See the I18N trail. Nutshell version from that tutorial, using newer API methods:
Depending on your actual usecase there may be some shortcuts (e.g., web frameworks often include direct support for localization via tag libraries, some libraries wrap up some busywork, etc.)