0

hi
I want to detect input language of client. so
i tried in java script with(navigator)it dosent work for my perpose
i also used ( HTTP_ACCEPT_LANGUAGE) it return system language not keyboard language?
what i must do?

3
Contributors
4
Replies
5
Views
7 Years
Discussion Span
Last Post by fxm
0

What are you trying to do, exactly?
Are you trying to adjust the page content based on some setting? If so, that is not a Good Thing.
My current keyboard configuration has nothing to do with the language(s) I want to see in pages I visit.

Offer the user a button to click - and, please, no flags.

0

forexample if client type in Persian textbox align must be "rtl"
and if he is typing in English textbox align must be "ltr"

0

if client type in Persian textbox align must be "rtl"
and if he is typing in English textbox align must be "ltr"

This little demo

<html> 
  <head> 
    <meta name="generator" content=
    "HTML Tidy for Windows (vers 25 March 2009), see www.w3.org"> 
    <title></title> 
  </head> 
  <body> 
    <textarea onclick="shoDir(this)" id='one' dir='rtl'> 
آزمون
</textarea> 
    <textarea onclick="shoDir(this)" id='two' dir='ltr'> 
test
</textarea> 
<script type="text/javascript"> 
function shoDir(that){
    alert(that.getAttribute('dir'))}
    </script> 
  </body> 
</html>

shows how to test the 'dir' attribute of a textarea. The code to set it is quite similar: .setAttribute('dir','rtl') or .setAttribute('dir','ltr') .

I don't have the required language support, so I can't test whether the attribute accessible to javascript changes when the keyboard is used to change the active language for input.

Caution: this toy does not specify a charset or codepage.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.