First off, I'm a PM and the dev team is already mad at me. So I'd like to take a shot creating the solution to the question below.
We have a static maintenance mode html page that displays "Please check back soon" in 24 languages. Right now we are displaying all 24 translations at once and the page is pretty ugly.
I've wrapped each translation into it's own div tag like this:
<div id="en">
<p>Please check back soon</p>
</div>
<div id="es">
<p>Compruebe por favor más adelante</p>
</div>
...
I'm looking to use javascript to detect the browser language and set visibility:visible; for the div that corresponds to the browser language. And set all the other div tags to visibility:hidden;
Looking for help with detecting browser language and stripping out locale (if provided) so I have a 2 character value to use in a complex switch.