participate


Internationalization (I18N) - Internationalization for Hebrew language
<<   Back to Forum  |   Give us Feedback
This topic has 5 replies on 1 page.
tonyMrsangelo
Posts:175
Registered: 8/6/07
Internationalization for Hebrew language   
Sep 22, 2009 10:28 AM

 
hi,

I made an application, internationalized to be used with some different languages.
Til now I internationalized it only for languages that have Latin letters (ISO/IEC 10646-1)
and in this way it is working fine...

Recently I had a request to put it in Hebrew language, that doesn't use Latin characters.

Reading the documentation, I implemented the localization for the Hebrew language in the
follow way:
Someone wrote the words in Hebrew characters inside a property file (file_iw_IL.properties) ,
afterwards I transformed the Hebrew characters in the UTF-16 mode "\uxxxx", using the
native2ascii tool that come with jdk ....

But when the application for the Hebrew language run, it didn't work...

I should like to know if the procedure that I did for Hebrew
internationalization is right and, if is not, I would like to know what is the right precedure
to make internationalization for languages that don't have Latin characters.

thank you in advance for a kind help
regards

tonyMrsangelo
 
tonyMrsangelo
Posts:175
Registered: 8/6/07
Re: Internationalization for Hebrew language   
Nov 3, 2009 8:15 AM (reply 1 of 5)  (In reply to original post )

 
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
 
DrClap
Posts:38,747
Registered: 4/30/99
Re: Internationalization for Hebrew language   
Nov 3, 2009 10:22 AM (reply 2 of 5)  (In reply to #1 )

 
You didn't say what "doesn't work" means in your first post and you didn't say what it means in your second post either. How about explaining what you expected to see, where you expected to see it, and what you saw instead? (Hint: you didn't say whether you were using a Java application or a web application or an applet or what.) And if you saw error messages, what were they? Just the general basic things that people would need to know.
 
tonyMrsangelo
Posts:175
Registered: 8/6/07
Re: Internationalization for Hebrew language   
Nov 4, 2009 2:57 AM (reply 3 of 5)  (In reply to #2 )

 
thank you for answering me

I precise better..

- saying "it doesn't" work I simply mean that I don't get the Hebrew translation
- I talk about a stand alone java application
- after I wrote in the file property with the Unicode I expected to get strings translated in Hebrew character in the same way I get the string in the English language
- I don't get error messages but when I set the class to use Hebrew language I get again English words...

regards

tonyMrsangelo
 
DrClap
Posts:38,747
Registered: 4/30/99
Re: Internationalization for Hebrew language   
Nov 4, 2009 9:31 AM (reply 4 of 5)  (In reply to #3 )

 
localUsedHe = new Locale("he", "HE");


I don't think this is correct. Usually you pass a language code and a country code to the Locale constructor. There's no country whose abbreviation is "HE", is there?
 
tonyMrsangelo
Posts:175
Registered: 8/6/07
Re: Internationalization for Hebrew language   
Nov 4, 2009 10:34 PM (reply 5 of 5)  (In reply to #4 )

 
I thank you very much for your good advice.

You are right : the right format is:

 localUsedHe = new Locale("iw", "IL"); 


now it works

regards
 
This topic has 5 replies on 1 page.
Back to Forum
 
Read the Developer Forums Code of Conduct

Click to email this message Email this Topic

Edit this Topic
  
 
 
Forums Statistics
    Users Online : 55
  • Guests : 140

About Sun forums
  • Sun Forums is a large collection of user generated discussions. It is here to help you ask questions, find answers, and participate in discussions.

    Check out our guide on Getting started with Sun Forums for a full walkthrough of how to best leverage the benefits of this community.

Powered by Jive Forums