Questions related to the Accept Language request header field of HTTP
Questions tagged [http-accept-language]
99 questions
0
votes
0 answers
Difference in Accept-Language and navigator.languages
According to MDN doc,
The Accept-Language HTTP header in every HTTP request from the user's browser uses the same value for the navigator.languages property except for the extra qvalues (quality values) field (e.g. en-US;q=0.8).
and spec
To avoid…

shtse8
- 1,092
- 12
- 20
0
votes
1 answer
AWS Amplify doesn't forward headers
I did deploy a nextjs application on aws amplify, everything is working well.
Now I wanted to use the accept-language header in my application, which does work when I call the cloudfront distribution domain(d2a2qapzh.cloudfront.net), but when I call…

Tom
- 1
- 1
0
votes
1 answer
Check if array value contains browser country code
I'm trying to show a link to a German version of my landing page if German is one of the browser languages, but the issue I am having is that the array is returning all languages in one value. How can I check to see if the value contains certain…

Robert
- 143
- 14
0
votes
1 answer
Is there way to fix accept language or currency?
I would like to ask how to fix random currency bacause iam trying to make price checker but when i run it for the firt time it gave me the currency in swedish crowns and the few minutes later it gave me different currency i tried accept language and…
0
votes
1 answer
Any Python modules out there that do anything with HTTP_ACCEPT_LANGAUGE?
I have read that decoding the potentially long string which can be returned from a website for HTTP_ACCEPT_LANGUAGE is not necessarily straightforward. Are there any packages out there in Python that try to do anything with this. I, in particular,…

demongolem
- 9,474
- 36
- 90
- 105
0
votes
1 answer
Redirect by Accept-Language header and preserve URL path
I'm reworking my website and I want Apache web server to redirect visitors like it's done on World of Tanks Europe website. For example, if I try to open URL https://worldoftanks.eu/news/, it would add en/ before news/ and open the page in…

SigmaTel71
- 21
- 6
0
votes
1 answer
Error parsing accept-language header in "search/fuzzy/json" api
We've come across a strange issue with fuzzy search requests that have begun to start failing in some browsers.
Running the search from test page here works. If you view this request in the network tab, and copy it as CURL, you get something…

kevflood
- 13
- 4
0
votes
1 answer
Firefox: See what modified my HTTP headers
How can I find out what part of my Firefox installation modifies my HTTP headers?
Using a tool that displays my headers for the corresponding request I can see my headers contain the following string:
Accept-Language:…

Robert Norden
- 100
- 1
- 9
0
votes
0 answers
docker nginx redirect based on http_accept_language
I have a static website where I want to create a redirection depending on the browser language. The website runs in a docker using nginx and is built as follows:
nginx.conf:
user nginx;
worker_processes 4;
error_log /dev/stderr info;
pid …

frosty4321
- 49
- 8
0
votes
0 answers
File input in HTML accept .pdf formats
I try to upload a file which accepts only pdf formats.
Although it filters all the files with .pdf extension, it shows also shortcuts with .url extensions. How can i make these shortcuts invisible to…

kbou
- 1
- 4
0
votes
2 answers
HTTP_ACCEPT_LANGUAGE always showing english
I'm trying to get the current user's language settings using:
$lang = substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2);
When I VPN into another country, or even use geopeeker.com, I still get "en" when I echo out $lang.
Is this method not the best…

Best Dev Tutorials
- 452
- 2
- 6
- 22
0
votes
1 answer
Scrape a page after translating it using bs4
I am trying to scrape a page which is in france by converting it into english.
Here is my code using beautiful soup and requests packages in python.
import requests
from bs4 import BeautifulSoup
url = ''
headers = {"Accept-Language":…

shashank
- 400
- 8
- 25
0
votes
1 answer
Getting a user's language in PHP
I am trying to do localization for a site I'm working on at the moment and am doing something like this:
if(!isset($_SESSION['lang'])){
$_SESSION['lang'] = substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2);
}else if(isset($_GET['lang']) &&…

Paddy Hallihan
- 1,624
- 3
- 27
- 76
0
votes
0 answers
Angular 5 JIT language
How do I get accept-language header in Angular +2? I'm using JIT and would like to load given language accordingly.
I have tried to get locale on bootstrap with:
const translations = require(`raw-loader!./locale/messages.${(window.clientInformation…

Wimza
- 61
- 1
- 1
- 5
0
votes
2 answers
Here API: Can accept-language header be used to get filter addresses (French versus English)
We are using the places/search endpoint to look up addresses.
Being based in Ontario, a lot of addresses have French and English version.
For example, looking for 360 Lisgar Ottawa, on will return 2 addresses in French and 2 in English…