Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Dec 21, 2011 08:32 AM by yahya_ammouri
Jun 01, 2010 11:37 PM|LINK
I wish to convert a string (english language) into it's equivalent Germen language.
key 65 is charachter 'a' but if the keyboard's layout is german and key code is 65, it should display the german charachter that equivalent to keycode 65....
Now, how do I achieve this kind of convertion?
Jun 02, 2010 01:17 AM|LINK
Im not sure if there is an implementation of such converter, but the first idea that came up in my mind was this:
1. Speaking for web application (thats why this forum is) you will need to do it on client-side
2. On TextBox where you will type the key chars, you may use onKeyUp event.
Exmp: <asp:textBox id="myTxt1" runat="server" onkeyUp="doConvert(this)" TextMode="MultiLine" />
In the link above you have all the keyChars. If you open the VIEW SOURCE of the site, search for Press a key and you will come to the function that is used to find which key is pressed and how you can proceed. I would recommend here using SWITCH instead
of just if-s.
4. Then just replace it to the string
Exmp: in the function above doConvert(this) means Im passing the value of the object to the function, so you will have the latest text in the textbox, you will only need to get the last character of the string and convert it as per your needs.
You can get the last character of the string like int he following example
var length = d.value.length;
var lastCharacter = d.value.charAt(length - 1);
then you have the last char, using the code from the site above, you can catch which keyboard char is pressed and replace the char. as appropriate.
Hope this helps a bit.
Dec 21, 2011 08:32 AM|LINK
try the below article
just change the property "TextLanguage" for textbox After adding German language