I did a bit of research regarding this & I have summarised my findings so far in below table
So the recommended solution is to write a a server side script to parse the Accept-Language
header & pass it to client for setting the language of the website. It's weird that why the server would be needed to detect the language preference of client but that's how it is as of now There are other various hacks available to detect the language but reading the Accept-Language
header is the recommended solution as per my understanding.