I am a beginner in java developer. I have wrote a java class file in eclipse for getting all key value pairs of spanish property file which as below:
public class ResoucreBundleproperties {
static void iterateKeys(Locale currentLocale) {
ResourceBundle labels =
ResourceBundle.getBundle("xxxx_ar_SP",currentLocale);
Enumeration<String> bundleKeys = labels.getKeys();
while (bundleKeys.hasMoreElements()) {
String key = (String)bundleKeys.nextElement();
String value = labels.getString(key);
System.out.println("key = " + key + ", " +
"value = " + value);
}
}
public static void main(String[] args) {
Locale[] supportedLocales = {
new Locale("SP","SPANISH"),
Locale.ENGLISH
};
iterateKeys(supportedLocales[0]);
System.out.println();
}
I got a output of xxxx.ar_SP.properties
with all keys and values.
Now I have another two more files of properties like yyyy_ar_SP.properties
and zzzz_ar_SP.properties
.
(pls tell me if any mistakes I done or u cant get me).
Question 1: now how will I get all these two property files (xxxx_ar_SP.properties,yyyy_ar_SP.properties,zzzz_ar_SP.properties
) in the same java class. Is that possible?
Question 2: how to convert the spanish property files to unicode escapes?