• Post Reply Bookmark Topic Watch Topic
  • New Topic

Arabic in Jforum  RSS feed

 
Ranch Hand
Posts: 492
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: 4422
108
  • 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: 492
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: 4422
108
  • 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: 492
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
 
Sheriff
Posts: 23505
47
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: 492
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: 19373
87
Android Eclipse IDE 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
Sheriff
Posts: 23505
47
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.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!