#396 incorrect language auto-selection by Accept-Language header on fp.o
Closed: Invalid Opened by shaiton.

The apache conf does not sent the correct language by default.
See other reports in [https://fedorahosted.org/fedora-infrastructure/ticket/2133 infra#2133], [https://fedorahosted.org/fedora-infrastructure/ticket/3389 infra#3389] and [http://lists.fedoraproject.org/pipermail/websites/2013-March/011231.html the ML].

Languages: pt, de.


I just updated the testApache.sh script on our repo in order to return incorrect values:

Here is the output:
http://paste.fedoraproject.org/4784/36301709/

I am checking the apache.conf files (as they are not shared between websites, yet)

I updated the script, here is a better output of the broken languages by website:

{{{
=== Checking boot.fedoraproject.org' === pt: Content-Language: pt-br === Checkingfedoracommunity.org' ===
bn: Content-Language: bn-in
pt: Content-Language: pt-br
=== Checking fedoraproject.org' === bn: Content-Language: bn-in de: Content-Language: de-ch pt: Content-Language: pt-br === Checkingfudcon.fedoraproject.org' ===
=== Checking spins.fedoraproject.org' === bn: Content-Language: bn-in pt: Content-Language: pt-br === Checkingstart.fedoraproject.org' ===
bn: Content-Language: bn-in
pt: Content-Language: pt-br
}}}

fudcon.fedoraproject.org is returning the correct code for all languages.
I can't see the error, as the apache conf file looks the same. Other eyes could help.
You can test localy, of course.

I still can't find the difference between fudcon and other websites.
The negociation algorithm does not look the same as we have the same LanguagePriority directive but not the same results. Even locally.

Here is a quick check:

{{{
$ curl -Iis start.fedoraproject.org --header 'Accept-Language: pt; q=0.5, pt-BR; q=0.5' |grep Content-Language
Content-Language: pt-br
$ curl -Iis fudcon.fedoraproject.org --header 'Accept-Language: pt; q=0.5, pt-BR; q=0.5' |grep Content-Language
Content-Language: pt
}}}

Any help appreciated.

Hi,

Thank you for your effort.

Even assuming that the transformation pt => pt-br is correct,
I would expect that "pt-pt" should present the page from "pt-pt" and it's not.

There are two forms of Portuguese, like in many other languages (English has more): The Portuguese from Portugal (pt-pt), AKA European Portuguese, and Portuguese from Brasil (pt-br).

If my browser ask for pt-pt I should not receive the page from pt-br.

Is there a rule for the code "pt" alone ?

Please, let me know if you need more help with testing.

Rui Gouveia

Hi ruigo,

yes we have a rule for pt alone. That's why asking pt should provide you pt. pt-pt does not exist here.
I really don't get why using the same quality (q=1) with pt and pt-br, we don't get the same for fudcon.fpo and start.fpo.

If you want to try yourself, you can clone our repo following the instructions there[1]. (I recommend you to use the --depth 1 switch by removing the hash).

Then, you go to start.fedoraproject.org folder, you run "make pt pt_BR en test" and then you can open the website through localhost:5000.
You would be able to locally test with

curl -Iis http://localhost:5000/ --header 'Accept-Language: pt; q=1, pt-BR; q=1' |grep Content-Language

"make stoptest" will kill the Apache server. And you can check again in the fudcon.fedoraproject.org folder.

The apache config files are (once built with the "test" make target) under httpd/conf/{httpd.conf,languages.conf}

[1] http://fedoraproject.org/wiki/How_to_fix_bugs_on_the_Fedora_Project_website

Thanks for helping us :)

Is this still not working for de and pt?

So I'm going to close finally this ticket :)

Fp.o actually is outdated and not used, i works apparently on getfedora.org.
Please file a new ticket if you encounter the issue on other websites too.

Metadata