Reputation: 711
I have a java ee application (With struts and hibernate), The application should allow users to process in Arabic language.
So once the user selects the system language(OS level) to Arabic it automatically allow user to enter texts in Arabic. But my problem is the login page Must only allow English characters even the system language is selected as Arabic.
So I add a button into the login page where a user can switch to type English characters instantly. But even after that the text box inputs are appear in Arabic. Is there another way that I can achieve this.
Please help and thanks in advance.
Upvotes: 1
Views: 229
Reputation: 48077
OS level language should have nothing to do with what a web application can accept - something sounds strangely wrong in that description.
If your system (when creating usernames) makes sure that only ASCII characters are allowed for usernames, it wouldn't hurt to accept arabic characters in the login screen - they just wouldn't ever log someone in successfully because there are no such usernames. However, I don't understand this limitation - why not also allow arabic usernames? If I knew how to switch my non-arabic browser to arabic, why shouldn't I be allowed to enter arabic, chinese or korean characters?
Now granted, ASCII is the easiest to support, because all the other alphabets are subject to encoding being messed up (on any level between database and browser). Once you've mastered this (and you probably have, otherwise you'd not have the arabic application), I don't see much of a problem.
Disclaimer: I'm aware of RTL languages but not deeply familiar with encoding of the change of alphabets and writing directions. Let me know if I totally misunderstand or which part doesn't make sense. If this doesn't answer your question, you might want to post (simplified) code snippets.
Upvotes: 2