How to detect language in an HTML form
I've got a forum where I'd like to allow only English. Can this be accomplished? How could I detect and block posts by lan开发者_Python百科guage?
Thanks.
IMO this is a complete waste of time. Let the forum community regulate it.
But if you're still wanting to go ahead, you could use the Google Translate API. http://code.google.com/apis/language/translate/v1/getting_started.html#usingDetect
It is hard, but possible. Here is an example using PHP:
http://phpir.com/language-detection-with-n-grams
精彩评论