wood burning stoves 2.0*
The moose likes Java in General and the fly likes Internationalization of Java Apps to Arabic Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Internationalization of Java Apps to Arabic" Watch "Internationalization of Java Apps to Arabic" New topic

Internationalization of Java Apps to Arabic

Moeness Baradei

Joined: Jan 11, 2009
Posts: 12

I am trying to get the java GUI to write in arabic.. I have actually reached output but I still have questions
Here is what I did:

1- Created the *.properties files in the usual way bel notepad, but named the file .txt instead of .properties
ex. greetings = اهلا

2-converted the arabic text to unicode escapes using native2ascii as follows:
ex: native2ascii -encoding cp1256 MessagesBundle_ar_EG.txt MessagesBundle_ar_EG.properties

3- The new .properties file now can be used successfully in swing components.

Now, this works.. I understand that I can do it another way, by making the properties file using a unicode ( UTF-8 ) editor.. which i tried to do using Yudit. But the result is strange characters.

Please Help.
Sunil Kumar
Ranch Hand

Joined: Apr 24, 2007
Posts: 76
The problem of strange characters comes when you save the file containing characters in a format that does not support all the characters in your file. So recheck the file format that you saved the file in.

Sunil Kumar
Eirik Rude

Joined: Jan 11, 2009
Posts: 1
Actually properties files can not be Unicode. That is with the exception of xml format properties files. The XML format is very nice, but you can't use the automatic Resource Bundle searching algorithm in the ResourceBundle class. Check out http://www.ibm.com/developerworks/java/library/j-tiger02254.html

Hope the helps,
Eirik Rude
Moeness Baradei

Joined: Jan 11, 2009
Posts: 12
Thanks for the xml way Eirik.
It is important that i can write in arabic and not in unicode escapes in the file for maintainability.
I agree. Here's the link: http://aspose.com/file-tools
subject: Internationalization of Java Apps to Arabic
Similar Threads
I18N arabic
Problem with fmt
Dynamically convert english numbers to arabic in jsp
Problem with internationalization.