Click here to Skip to main content
15,892,005 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I only need to know how to make a javascript code in which, the code at first asks for WordPress website language.

What I have tried:

I know the code in PHP language if it helps:
PHP
mylocale = get_bloginfo('language');

P.S: I know that there is a javascript code which finds out about browser language.
JavaScript
<script type="text/javascript">
var userLang = navigator.language || navigator.userLanguage; 
alert ("The language is: " + userLang);
</script>

But I need to find out about wordpress langugae, e.g: lang="en-US"
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900