Is there a way to determine the language of a Wordpress page using Javascript?
I have discovered a method to detect Spanish:
if(window.location.href.indexOf("/es/") > -1) {
However, if the website does not use Permalink Settings with "Post name", the language preference will be indicated by ?lang=es
in the URL.
Furthermore, can the lang preference for a Wordpress page be something like "en-uk"?