Make Obsidian send the right `Accept-Language` header

Well this has been turned down as a bug, so here is the requested Feature Request:

Make Obsidian send its selected language in the HTTP Headers instead of the language of the OS. People might get <iframe> results in the wrong language otherwise.

I feel that if a user explicitly selects a language for the Obsidian UI, she expects it to behave like it and respect the setting everywhere. Browsers do this as well (plus you can also set it manually on browsers).

Steps to reproduce

User your own servers or a service like https://manytools.org/http-html-text/http-request-headers/ to check what HTTP headers Obsidian sends upon requests. These are used for instance when embedding an <iframe>.

Now the system language and the language you wish to work in in Obsidian can differ, in my case I run a German-language Linux system but want to work in English.

So my Obsidian is set to English but some iframed content will still be delivered in German! Why? Because some servers are more clever than others and actually respond to the Accept-Language HTTP header.

Now Obsidian sends whatever it knows about the system, not it’s own setting (which the user has deliberately made)!

So on my system Obsidian sends an

Accept-Language: de

because my system is set up with a German Linux but my Obsidian set to English!

Obsidian devs, hear me? Bug!

It should send an

Accept-Language: en,de-DE;q=0.7,de;q=0.5,*;q=0.3

in this case (German system, Obsidian English), so that

  • we get the iframe content in the language Obsidian is set to (en), and
  • the real system language (de_DE) as a fallback, then
  • the abbreviated (general) system language (de) as a further fallback!

Expected result

Accept-Language: en,de-DE;q=0.7,de;q=0.5,*;q=0.3

Actual result

Accept-Language: de

Environment

  • Operating system: Linux Mint 20.1/Cinnamon
  • Obsidian version: 0.12.3, installer 0.12.3

Additional information

Since Obsidian seems to know about the system language, and definitely about the language it’s set to, it should be trivial to send the correct Accept-Language HTTP header.


Related: <iframe> - YouTube Embed privacy question - #9 by Moonbase59