The static content has been hard coded in Java files like this:
String s = "<span class=\"className\">StaticContent</span>";
It has to be externalized using ResourceBundle objects.
A simple method of doing it is:
String s = "<span class=\"className\">" +
ResourceBundleObject.getString("StaticContent.key") + "</span>";
The second method is using StringBuilder object:
StringBuilder sb = new StringBuilder();
sb.append("<span class=\"className\">");
sb.append(ResourceBundleObject.getString("StaticContent.key"));
sb.append("</span>");
String s = sb.toString();
Does second method have advantage over the first one (in terms of resources consumed)?
It's easier to use first method as it involves very less editing.
private final String TEMPLATE = "<span class=\"className\">%s</span>"and create your Strings usingString.format(String, Object...). For exampleString s = String.format(TEMPLATE,ResourceBundleObject.getString("StaticContent.key")). This method is not efficient at all but is programmaticly convenient.