If I have a resource bundle properties file:
A.properties:
thekey={0} This is a test
And then I have Java code that loads the resource package:
ResourceBundle labels = ResourceBundle.getBundle("A", currentLocale); labels.getString("thekey");
How can I replace the text {0} with some value
labels.getString("thekey", "Yes!!!");
Such that the output is obtained as:
Yes!!! This is a test.
There are no methods that are part of the Resource Bundle to do this. Also, I'm in Struts, is there any way to use MessageProperties to replace.
source share