Get page language in javascript
-
Hello,
How to get the language of a WordPress page in Javascript?
I have found a way to check for Spanish:
if(window.location.href.indexOf("/es/") > -1) {
But if the website is not with Permalink Settings with “Post name”, the language preference will be with ?lang=es in the URL.
And, can a WordPress lang preference be “en-uk” for example?
I am looking for a Javascript way whatever the settings of WordPress.
Thanks guys!
Viewing 12 replies - 1 through 12 (of 12 total)
Viewing 12 replies - 1 through 12 (of 12 total)
- The topic ‘Get page language in javascript’ is closed to new replies.