开发者

Knowing the language used in a form

开发者 https://www.devze.com 2022-12-30 12:34 出处:网络
I\'m working on a site with form开发者_如何学编程s that require a certain language to be used. (Something like a dictionary). I want to know if there is a way in JavaScript/HTML to check the language.

I'm working on a site with form开发者_如何学编程s that require a certain language to be used. (Something like a dictionary). I want to know if there is a way in JavaScript/HTML to check the language. For example, if I need the input in Japanese and the user gives me an English word, it is detected as an error.


You could take a look at the Google AJAX Language API and there's an example of language detection.


No, there is not a way to do this with straight java/html. The best you could do is hope that UTF-8 is the encoding, and then you check the character class. But that still doesn't really tell you which language is used.


No, you need to implement a function or use a specific library.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号