I have an asp:TextBoxa and asp:Button in my website. A user is writing some text in textbox1 and then click button1. How can i check what culture/language is the written string?
Yes, these 2 links are doing what i want for my question but it's not quite what i need. I wanted to make example easier but it went to wrong solution. So, I don't want to detect the language, i want to detect the different alphabet / language family. For
example:
If somebody writes "a" string in Cyrillic and "a" string in Latin (en-US, fr-FR, de-DE, etc.) to determine the Cyrillic. If he writes some word in Chinese, Arabic etc. I also want to detect that.
Why I need that - I have AutoComplete function in a TextBox and for example if somebody writes "a" in Cyrillic the AutoComplete function is looking through values with Latin language family and doesn't trigger. To the user, it's like there's no AutoComplete.
When the user continues to write maybe he'll catch that he's writing on Cyrillic, but still i want to detect that. :)
*yes, i want to trigger on the first word.
p.s. maybe the google example will do this, but it's still very complicated thing to do for my purpose. I guess there's something in the CS language for that action.
Digitborn.co...
Member
684 Points
450 Posts
Check localization/language of a string
Apr 22, 2012 10:34 AM|LINK
Hello,
I have an asp:TextBoxa and asp:Button in my website. A user is writing some text in textbox1 and then click button1. How can i check what culture/language is the written string?
avinash_bhud...
Contributor
2881 Points
517 Posts
Re: Check localization/language of a string
Apr 22, 2012 11:08 AM|LINK
May be this will help you.
http://www.codeproject.com/Articles/43198/Detect-a-written-text-s-language
http://stackoverflow.com/questions/1192768/return-the-language-of-a-given-string/1192802#1192802
Digitborn.co...
Member
684 Points
450 Posts
Re: Check localization/language of a string
Apr 22, 2012 01:46 PM|LINK
Yes, these 2 links are doing what i want for my question but it's not quite what i need. I wanted to make example easier but it went to wrong solution. So, I don't want to detect the language, i want to detect the different alphabet / language family. For example:
If somebody writes "a" string in Cyrillic and "a" string in Latin (en-US, fr-FR, de-DE, etc.) to determine the Cyrillic. If he writes some word in Chinese, Arabic etc. I also want to detect that.
Why I need that - I have AutoComplete function in a TextBox and for example if somebody writes "a" in Cyrillic the AutoComplete function is looking through values with Latin language family and doesn't trigger. To the user, it's like there's no AutoComplete. When the user continues to write maybe he'll catch that he's writing on Cyrillic, but still i want to detect that. :)
*yes, i want to trigger on the first word.
p.s. maybe the google example will do this, but it's still very complicated thing to do for my purpose. I guess there's something in the CS language for that action.
avinash_bhud...
Contributor
2881 Points
517 Posts
Re: Check localization/language of a string
Apr 22, 2012 02:47 PM|LINK
These links will help you to determine cyriilic letters.
http://stackoverflow.com/questions/3079388/how-can-i-convert-cyrillic-string-into-english-in-c-sharp
http://stackoverflow.com/questions/7821118/how-to-read-cyrillic-symbols-from-a-txt-file-with-c-sharp
http://www.pcreview.co.uk/forums/convert-dos-cyrillic-text-unicode-t1413187.html