fabi1cazenave / webL10n

Client-side internationalization / localization library
http://fabi1cazenave.github.com/webL10n/
278 stars 70 forks source link

Don't replace in-html strings on load if navigator.language matches document.lang #14

Closed sonnyp closed 9 years ago

pandark commented 12 years ago

navigator.language is based on the value of the Accept-Language HTTP header only since Gecko 5.0 (Firefox 5.0 / SeaMonkey 2.2) https://developer.mozilla.org/en-US/docs/DOM/window.navigator.language#Browser_compatibility Same thing for chrome/chromium, changed about a little less than 4 years ago http://src.chromium.org/viewvc/chrome?view=rev&revision=2250 So, you'd have to do user-agent (version) detection for these (or use the system language instead of the user language for older releases).

Opera, as far as I know, still gives the OS language instead of accept-language.

Closest thing in Internet Explorer is userLanguage (or browserLanguage?), and it's not really the same http://msdn.microsoft.com/en-us/library/ms534713.aspx http://msdn.microsoft.com/en-us/library/ms533542.aspx

fabi1cazenave commented 11 years ago

PR #33 should do the job.