No one answer me so I try again for some help, explain better my problem.
I use this class to get strings in different languages:
public class SupplierOfInternationalizedStrings {
Locale localUsedIt;
Locale localUsedEn;
Locale localUsedHe;
//
Locale localizedCurrencyFormat;
//
Locale localUsedHere;
//
public SupplierOfInternationalizedStrings() { // constructor
localUsedIt = new Locale("it", "IT"); // specifica il file appartenente alla famiglia
localUsedEn = new Locale("en", "US"); // specifica il file appartenente alla famiglia
localUsedHe = new Locale("he", "HE"); // specifica il file appartenente alla famiglia
} // constructor
void setInternationalizationCountry(String langToUse) {
if (langToUse.compareToIgnoreCase("Italiano") == 0) {
localUsedHere = localUsedIt;
localizedCurrencyFormat = new Locale("it", "IT");
} else if (langToUse.compareToIgnoreCase("English") == 0) {
localUsedHere = localUsedEn;
localizedCurrencyFormat = new Locale("iw", "IL");
} else if (langToUse.compareToIgnoreCase("Hebrew")== 0) {
localUsedHere = localUsedHe;
localizedCurrencyFormat = new Locale("iw", "IL");
}
System.out.println("linguaggio impostato = " + localUsedHere);
} // initializeInternationalization()
public String getInternationalString(String keyForTheWord) {
ResourceBundle resourceBund = ResourceBundle.getBundle("properiesFile", // il nome del file .properties... la famiglia dei files
localUsedHere);
String word = resourceBund.getString(keyForTheWord);
return word;
} // getStringForMedidentStartClass()
} // class SupplierOfInternationalizedStrings
Of course I have a file.property iw_IL - Hebrew (Israel) where for each key there is a value wrote with hebrew characters
the hebrew file property look in this way:
keyForLabel1= ה עברית מילה שתימ \n
keyForLabel2=ספה עברית מילה שתימ
The class SupplierOfInternationalizedStrings works for the translation in english and in other languages that use latins letters ..,
but when it is setted for be used with the Hebrew language ( localUsedHere = localUsedHe)
the metod getInternationalString() don't return Hebrew words.
This didn't worry me, because I read in the documentation that properies file cannot
read characters that are different from latine... and I also learned that in this case it need to convert the letters
in Unicode format...
I made this work putting the hebrew words in an .rtf file and, using native2ascii utility
with the command native2ascii -encoding UTF8 file.rtf textdoc.txt, I got the unicode format.
Now the file property for Hebrew language looks in this way:
keyForLabel1 = \u00d4 \u00e2\u00d1\u00e8\u00d9\u00ea...
keyForLabel2 = \u00e1\u00e4\u00d4 \u00e2\u00d1.....
At this point I expected the translation in Hebrew comes good... but instead I still I cannot get the Hebrew words..
I should like to know why the elaboration still doesn't works
and I would have too some help in order to do the program works good.
thank you
regards
tonyMrsangelo