I'm trying to access user's language preference w/o using server code.
I'm looking for some JavaScript like this:
var language_array = jQuery.languagePreferences();
//en-ca,en;q=0.8,en-us;q=0.6,de-de;q=0.4,de;q=0.2
I know I can use HTTP_ACCEPT_LANGUAGE on server side, but what about in JavaScript/JQuery client-side static (non-server generated) page?
I've done a fair amount of Googling and have no clear browser agnostic solution.. how does JavaScript gain access to browsers' list of preferred user languages? (as configured, say, in FireFox with Tools > Options > Content > Languages) It seems this is too hard.
If it's not possible it seems these might work:
1) [A question for ServerFault.com] Use server-side URL rewriting so Apache will respond with correct static page based on language preference?
2) Use AJAX on client to query server solely to read HTTP_ACCEPT_LANGUAGE? Seems very convoluted!
Am I missing something?