This week's book giveaways are in the Scala and Android forums.
We're giving away four copies each of Machine Learning Systems: Designs that scale and Xamarin in Action: Creating native cross-platform mobile apps and have the authors on-line!
See this thread and this one for details.
Win a copy of Machine Learning Systems: Designs that scale this week in the Scala forum
or Xamarin in Action: Creating native cross-platform mobile apps in the Android forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Internationalization of Java Apps to Arabic  RSS feed

 
Greenhorn
Posts: 12
  • 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.
 
Ranch Hand
Posts: 81
  • 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.
 
Greenhorn
Posts: 1
  • 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
  • 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.
 
Don't listen to Steve. Just read this tiny ad:
Rocket Oven Kickstarter - from the trailboss
https://coderanch.com/t/695773/Rocket-Oven-Kickstarter-trailboss
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!