Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / First Aid / February 2006

Tip: Looking for answers? Try searching our database.

language customization

Thread view: 
smarto59@hotmail.com - 06 Feb 2006 17:22 GMT
Im developing an application that accepts arabic string in
a text field. just I want to customize the application
to set the default language in arabic means the user
doesn't have to converts the language or the direction(right-to-left)
of the text from the keyboard. he just can insert the arabic string
directly.

thanks.
Mark Thomas - 06 Feb 2006 17:55 GMT
> Im developing an application that accepts arabic string in
> a text field. just I want to customize the application
[quoted text clipped - 4 lines]
>
> thanks.

You might try looking at the Locale class.  Something like:

    Locale.setDefault("ar","SA");

for Saudi Arabic.

Mark
Thomas Fritsch - 06 Feb 2006 18:49 GMT
> You might try looking at the Locale class.  Something like:
>
>     Locale.setDefault("ar","SA");
>
> for Saudi Arabic.

As an alternative you can call your java application with some special
system properties:
  java -Duser.language=ar -Duser.region=SA ...
The effect is the same as above: The default locale is set to ar_SA.

Signature

"Thomas:Fritsch$ops:de".replace(':','.').replace('$','@')

smarto59@hotmail.com - 06 Feb 2006 19:10 GMT
Thank you Thomas and the sun of Thomas Im glad to hear from you.
in fact I've tried Locale class already and this is a peice of my code:

         Locale locale = new Locale("ar","SA");
         Locale.setDefault(locale);
but still when i type a text in the text field it appears in English.
and I
have to convert it in to arabic from the keyboard abbrivaition.
Also Im trying to use Font.layoutGlyphVector to change the
direction of the text -right to left- but I don't know how to do that.
so help plz
Roedy Green - 06 Feb 2006 23:15 GMT
>but still when i type a text in the text field it appears in English.

You have to swap the keyboard driver.  I don't think Java does this
for you.  If you are using windows, go in the control panel keyboard
and set up a hot swap between Arabic and English keyboard layouts.
Signature

Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.

Roedy Green - 06 Feb 2006 23:13 GMT
>You might try looking at the Locale class.  Something like:
>
>    Locale.setDefault("ar","SA");

You can also discover the default locale. See
http://mindprod.com/jgloss/locale.html
Signature

Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.