15

In Firefox Accept-Language is set globally for the browser in the general preferences or via an extension like "Modify Headers" for more frequent changes.

But how to do that in Safari?

Safari. On OS X the language sent is that specified in the OS X system language preferences. To change those preferences go to System Preferences > Language & Region > Preferred Language, but be aware that it will change the language of your user interface, not just your browser language preferences. Make sure you know how to switch back to your normal language!

That is very inconvenient.

Is there a way to do the same with Safari, to simulate a different language/location, for example for web development purposes?

LаngLаngС
  • 8,023
  • 10
  • 38
  • 89
Gustavo
  • 575
  • 3
  • 8
  • 21
  • Does this solve it for you https://apple.stackexchange.com/questions/245/is-it-possible-to-launch-a-program-in-a-specific-language – Mr R Mar 19 '21 at 16:41
  • This might work, since he wants to run one app under a different language that the default macOS language. However, the link provided in the right answer is no longer working, the name is for sale and I suspect the app won't work anymore. Besides, we need to know if Safari will sent the HTTP header based on this parameter (app running language) or the OS default (will get from preferences). In Safari's case, an extension might be a better way, thought. – Gustavo Mar 21 '21 at 13:53

2 Answers2

1

One way to set the language for Safari without changing the language for the entire system, is to go into System Preferences > Language & Region > Apps. Here you can add a new entry to customise the language for Safari only.

  • Great! I haven't fully tested it yet, need to know if the server will assume I am using other language. This feature didn't exits when I opened this thread, nice addition to de OS. But be advised that might be a slow process since the OS will scan for all apps and languages. – Gustavo Aug 06 '21 at 12:51
  • 1
    @Gustavo Do let us know if it works so that you actually get the right language websites from just changing the Safari interface language. – Tom Gewecke Aug 06 '21 at 13:55
  • Unfortunately this does not work, I just tried it. It changes the UI language of the Safari app to English, but it will still send whatever you have as "primary" language of the OS in the `Accept-Language` header. – Alexander Klimetschek Apr 29 '22 at 23:41
  • I just landed on this question again. Apparently, it does not work anymore. I do remember using this method successfully in an older version of Safari. – Adriaan Zonnenberg Jul 20 '22 at 10:31
0

You can change the language of any website in any browser(Safari, Chrome, Firefox..) by creating a Modify Headers rule in Requestly

enter image description here

This will add the header Accept-Language in Safari for the URLs present in the rule. This is instantly reflected in your browser without changing any System Preferences

Disclaimer: I work at Requestly

Sahil Gupta
  • 121
  • 3
  • This sound cool, but :) ...it requires a system wide proxy through which requests from ALL apps go through (AFAICS). Seems overkill for changing one header value in one app, and probably introduces more issues than it solves. – Alexander Klimetschek Apr 29 '22 at 23:47