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.
As of Sept 2021, on Mac (M1):
window.navigator.language
:(thanks to @AdamBittlingmayer above)
defaults write com.google.Chrome AppleLanguages '(es, es-ES)'
To verify:
defaults read com.google.Chrome