I'm trying to internationalize an app and need to test how it behaves in other locales.
However, navigator.language
always returns en-US
, even if I change language settings in both Chrome and OS X.
What can I do to the browser to force navigator.language
to return something like es-MX
?
Clarification
I'm trying to make the change as a user, through the GUI, not with code.
Use chrome://settings/languages#lang and (important) make sure that the language you selected is the top choice (the preferred language).
More information: https://alicoding.com/detect-browser-language-preference-in-firefox-and-chrome-using-javascript/