views:

68

answers:

2

I know that in Wordpress we can do the following:

preg_match("/\p{Arabic}/u",
get_the_title())

How can we do this in JavaScript? Thanks in advance.

+1  A: 

You could do this via the Google Language API http://stackoverflow.com/questions/1441562/detect-language-from-string-in-php

powtac
I know how to detect language on php, I showed you that I know how! I want to do that on the client side " Java script "
zeina
@zeina: Did you see the answers in that link? There is an example that uses javascript (and AJAX) to detect the language. Javascript alone, as a language, does not have that capability.
Chetan Sastry
Google have ajax apis too
Ayaz Alavi
A: 

Wouldn't it be easier to use qTranslate?

Julian
This seems word press like, I'm not working with word press.
zeina