Im using Java resource bundles to localize my application and I have created a function which returns a message localized according to a resource bundle from a code... something like this:
public String getDescription(String code, ResourceBundle resBundle){
String returnValue = null;
try{
returnValue=resBundle.getString(code);
}catch(Exception ex){
returnValue = null;
}
}
But, what I want to know if it is possible to add an entry to the resource bundle in case the code passed doesn't exist there, something like:
if(!resBundle.containsKey(code)){
//This next line is pseudo-code... it is not valid at all
resBundle.addEntry(code, "xyz");
}
Any help?