Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
Win a copy of Soft Skills: The software developer's life manual this week in the Jobs Discussion forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Internationalization of Java Apps to Arabic

 
Moeness Baradei
Greenhorn
Posts: 12
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Greetings

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
Posts: 76
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Eirik Rude
Greenhorn
Posts: 1
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
i18ncookbook.com
 
Moeness Baradei
Greenhorn
Posts: 12
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic