• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Knute Snortum
  • Bear Bibeault
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Frits Walraven
  • Carey Brown
  • Tim Holloway

Arabic in Jforum

 
Ranch Hand
Posts: 493
Android Eclipse IDE Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi ,
i'm trying to change the Jforum to Arabic , so i added ar_AR.properties file to config-->languages , and added it to locale.properties file , also added to the Glassfish JVM options
?


, but i'm getting the Arabic as trash as in the below screenshots ,  any solutions for this ?
Capture2.JPG
[Thumbnail for Capture2.JPG]
Capture3.JPG
[Thumbnail for Capture3.JPG]
 
Saloon Keeper
Posts: 5579
144
Android Mac OS X Firefox Browser VI Editor Tomcat Server Safari
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Just to ask the obvious: which encoding is the ar_AR.properties file in? (I'm assuming that you do have a font installed that has Arabic characters.)

Also, you might try asking in the forums where the JForum developers hang out at http://jforum.andowson.com/forums/
 
S Shehab
Ranch Hand
Posts: 493
Android Eclipse IDE Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Tim Moores wrote:Just to ask the obvious: which encoding is the ar_AR.properties file in? (I'm assuming that you do have a font installed that has Arabic characters.)

Also, you might try asking in the forums where the JForum developers hang out at http://jforum.andowson.com/forums/



Hi ,
the Arabic file ar_AR.properties was placed in config-->languages folder. i think i have all the needed Arabic fonts because i can read and write Arabic on notepad or office.
 
Tim Moores
Saloon Keeper
Posts: 5579
144
Android Mac OS X Firefox Browser VI Editor Tomcat Server Safari
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

the Arabic file ar_AR.properties was placed in config-->languages folder.


That doesn't answer the question which encoding the file is in.
 
S Shehab
Ranch Hand
Posts: 493
Android Eclipse IDE Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Tim Moores wrote:

the Arabic file ar_AR.properties was placed in config-->languages folder.


That doesn't answer the question which encoding the file is in.



UTF-8
 
Marshal
Posts: 24594
55
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And when you use that properties file, are you ensuring that your code reads it as UTF-8? I ask because the methods in the java.util.Properties class assume that the file is encoded in ISO-8859-1, with Unicode escapes being used for characters which aren't in the Latin character set. Have a look at the API documentation for Properties for more detail.
 
S Shehab
Ranch Hand
Posts: 493
Android Eclipse IDE Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Paul Clapham wrote:And when you use that properties file, are you ensuring that your code reads it as UTF-8? I ask because the methods in the java.util.Properties class assume that the file is encoded in ISO-8859-1, with Unicode escapes being used for characters which aren't in the Latin character set. Have a look at the API documentation for Properties for more detail.



Hi ,
Actually i'm not writing any code here what i want to achieve is to make the Jforum interface Arabic , that's all.
 
Bartender
Posts: 20842
125
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Make sure that the web client (browser) is set up for an Arabic code page and that the encodings for that page are the same as what are in your properties file.

I notice that somewhere along the line, Firefox seems to have shifted to Unicode for its default, but in earlier times you have to be more careful.

In addition to having the right codeset on the server and the right decoding on the client, the other thing that can zap you is if you override the encoding selection in the HTML headers that your server sends to the client.
 
Paul Clapham
Marshal
Posts: 24594
55
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Paul Clapham wrote:I ask because the methods in the java.util.Properties class assume that the file is encoded in ISO-8859-1, with Unicode escapes being used for characters which aren't in the Latin character set. Have a look at the API documentation for Properties for more detail.



Okay, so it isn't your code reading the properties file. But the rules which I mentioned about properties files still apply. You may think it would be tedious to figure out the necessary Unicode escapes for a large quantity of Arabic text -- and it would be -- but the API documentation tells you about a program which will do that conversion for you.

On the other hand if you used an XML-formatted properties file then the charset can be whatever you like, as long as the prolog declares it correctly. So if you can use that instead of the old-fashioned line-oriented Properties file, that would be better.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!