Opened 12 years ago

Closed 11 years ago

#8970 closed bug (fixed)

WebPositive doesn't set http_accept_language header

Reported by: xray7224 Owned by: leavengood
Priority: normal Milestone: R1
Component: Applications/WebPositive Version: R1/Development
Keywords: Cc: jessica.l.hamilton@…
Blocked By: Blocking:
Platform: All

Description

Hey,

I have noticed that when I changed my locale sites which I know respond to this such as google, bbc, (I think wikipedia automatically does it too) don't with WebPositive on Haiku. I started playing with PHP to see what the browser is sending and while you include the set locale in the user-agent the HTTP_ACCEPT_LANGUAGE which lists languages (ranks them in priority so you can fall back if you don't have translations for x language). The PHP code I used to check this is:

<?php
var_dump($_SERVER["HTTP_ACCEPT_LANGUAGE"]);
?>

You can see when you test it with other browsers it lists the languages and I believe most web developers use this to decide what language to provide the website in, something important to those who set their locale to something other than the default language the website provides.

Change History (6)

comment:1 by aldeck, 12 years ago

Adding the current locale to the user agent is something i added in July and it seemed to work in my limited testing. I assume you're testing on a recent Haiku revision?

Also i'm affraid i don't understand the following sentence of yours though : "while you include the set locale ...." (i'm missing the second part of the while). I'd be happy to help if you have more knowledge on the subject :)

comment:2 by xray7224, 12 years ago

Erm it is there but I don't think many websites (such as google) work from that they typically go off the http-accept-language header most browsers have something like (output from var_dump($_SERVER["HTTP_ACCEPT_LANGUAGE"]) (PHP)):

from elinks

String(11) "en, *;q=0.1"

from BeZillaBrowser

string(14) "en-us,en;q=0.5"

from Firefox 15.0 on linux

string(14) "en-us,en;q=0.5"

from Chromium 18.0.1025.151

string(26) "en-GB,en-US;q=0.8,en;q=0.6"

And finally from WebPositive 1.1 running on haiku hrev44584

NULL

(NULL in PHP means it's not set, so websites typically are not picking up on it as I believe most and the sites i've implemented use this to tell it what language to use)

Erm I think i forgot to remove the while (re-worded what I was trying to say) sorry. Basically it'd be nice if when you change your locale settings in haiku this header changed so websites are translated into the language of choice.

Version 1, edited 12 years ago by xray7224 (previous) (next) (diff)

comment:3 by jessicah, 12 years ago

Cc: jessica.l.hamilton@… added

comment:4 by dsjonny, 12 years ago

Using 45385 nightly the problem is still exists. I suggest to check this site from Web+ and from other browser to check "what is missing": http://show-ip.net/useragent/

comment:5 by dsjonny, 12 years ago

I have created a "test" PHP file:

Web+

    [HTTP_HOST] => www.d-rendszer.hu
    [HTTP_ACCEPT_ENCODING] => deflate, gzip
    [HTTP_USER_AGENT] => Mozilla/5.0 (compatible; U; Haiku x86; hu) AppleWebKit/536.10 (KHTML, like Gecko) Haiku/R1 WebPositive/1.1 Safari/536.10
    [HTTP_ACCEPT] => text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
    [HTTP_CACHE_CONTROL] => max-age=0

QupZilla

    [HTTP_USER_AGENT] => Mozilla/5.0 (Unknown; UNIX BSD/SYSV system) AppleWebKit/534.34 (KHTML, like Gecko) QupZilla/1.4.0 Safari/534.34
    [HTTP_ACCEPT] => text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
    [HTTP_DNT] => 1
    [HTTP_ACCEPT_LANGUAGE] => hu-HU, en-us;q=0.8, *
    [HTTP_COOKIE] => DROldalLogin=1; DROldalPass=5ab8d4f9d7359cb26bab78355c930772
    [HTTP_CONNECTION] => Keep-Alive
    [HTTP_ACCEPT_ENCODING] => gzip
    [HTTP_HOST] => www.d-rendszer.hu

BeZilla

    [HTTP_HOST] => www.d-rendszer.hu
    [HTTP_USER_AGENT] => Mozilla/5.0 (BeOS; U; Haiku BePC; en-US; rv:1.8.1.25pre) Gecko/20120921 BonEcho/2.0.0.22pre
    [HTTP_ACCEPT] => text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
    [HTTP_ACCEPT_LANGUAGE] => hu,en-us;q=0.5
    [HTTP_ACCEPT_ENCODING] => gzip,deflate
    [HTTP_ACCEPT_CHARSET] => ISO-8859-1,utf-8;q=0.7,*;q=0.7
    [HTTP_KEEP_ALIVE] => 300
    [HTTP_CONNECTION] => keep-alive
    [HTTP_COOKIE] => DROldalLogin=1; DROldalPass=5ab8d4f9d7359cb26bab78355c930772
    [HTTP_CACHE_CONTROL] => max-age=0

comment:6 by pulkomandy, 11 years ago

Resolution: fixed
Status: newclosed

Fixed in https://github.com/haiku/webkit/commit/9327a14dd0f8db38dd7b5e1600d8a22e07a85639. This will be available in HaikuWebKit 1.3.1.

Note: See TracTickets for help on using tickets.