set language according to the machine culture in polylang
-
I am using the polylang plugin on my website. The website is supposed to be open in different parts of the world. I want that, if the website is opened in, e.g, germany then default language of website should be german and if the website is accessed in spain then default language of website should be spanish. How this can be achieved using polylang.
I was trying on my local project and implementing this using jquery. My logic was like, I was using this $_SERVER[‘HTTP_ACCEPT_LANGUAGE’]. This gives me language culture like en, ge, hu and passing this to a jquery script which is passed in a switch case and accordingly
current-lang
class is added to the language item.Please help I need it urgently.
- The topic ‘set language according to the machine culture in polylang’ is closed to new replies.