I have four properties files
- Application.properties
- Application_fr_FR.properties
- Database.properties
- Database_fr_FR.properties
So now I need internationalization in multiple programs, so now I need to load multiple properties files and get the key-value pair of values from properties files specific to a locale. For that I have a ResourceBundleService.java
public class ResourceBundleService {
private static String language;
private static String country;
private static Locale currentLocale;
static ResourceBundle labels;
static {
labels = ResourceBundle
.getBundle("uday.properties.Application");
labels = append(Database.properties");
//** how to append existing resource bundle with new properties file?
}
public static String getLabel(String resourceIndex, Locale locale) {
return labels.getString(resourceIndex);
//How to get locale specific messages??
}
}
Hope the question is clear.