Project

General

Profile

Actions

Bug #59649

closed

Issue with safari and HTTP_ACCEPT_LANGUAGE with locale 'fr-fr'

Added by Hennebicq Romain over 10 years ago. Updated over 9 years ago.

Status:
Closed
Priority:
Should have
Category:
-
Target version:
-
Start date:
2014-06-18
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
4.5
PHP Version:
Tags:
Complexity:
Is Regression:
No
Sprint Focus:

Description

Hello,

We found an issue with the HTTP_ACCEPT_LANGUAGE detection,
when we use safari 7.0.4 with the locale set to 'fr-FR' on osx 10.9.3 the typo3 page are displayed with french and english language (because the default language is french and some pages have no english version).
On the page http://www.univ-paris1.fr/universite/ in the menu the entry "CAMPUS" should be "Implantations" .

So we have created a patch :

class.t3lib_matchcondition_abstract.php
protected function evaluateConditionCommon($key, $value) {
...
case 'language':
$values = t3lib_div::trimExplode(',', $value, TRUE);
foreach ($values as $test) {
if (preg_match('/^\*.+\*$/', $test)) {
$acceptLang = t3lib_div::getIndpEnv('HTTP_ACCEPT_LANGUAGE');
$acceptLang = preg_replace('/-[a-z]+/i', '', $acceptLang);
$allLanguages = preg_split('/[,;]/', $acceptLang);
if (in_array(substr($test, 1, -1), $allLanguages)) {
return TRUE;
}
} elseif (t3lib_div::getIndpEnv('HTTP_ACCEPT_LANGUAGE') == $test) {
return TRUE;
}
}
break;
...

regards,

Romain

Actions #1

Updated by Susanne Moog over 10 years ago

  • Status changed from New to Needs Feedback

Can you describe what the problem is? How does your configuration (TypoScript) look like? What does your solution do and why?

Actions #2

Updated by Hennebicq Romain over 10 years ago

Any browser with language set to 'fr-fr' or 'fr-FR' or '*-*' aren't recognize by the typo3 HTTP_ACCEPT_LANGUAGE function.
With safari in a french osx the value send by the browser is 'fr-FR', but all the page in typo3 (default language is french) are displayed in english if the french page have a traduction in english.

the patch convert the 'fr-FR' to 'fr'.

http://www.w3.org/International/questions/qa-lang-priorities.en.php

Romain

Actions #3

Updated by Alexander Opitz over 10 years ago

  • Status changed from Needs Feedback to New
Actions #4

Updated by Riccardo De Contardi over 9 years ago

  • Status changed from New to Needs Feedback
  • Assignee set to Hennebicq Romain

Please, can you tell us if the bug is still present in the latest versions like 6.2.12 or 7 (latest master)? Thank you!

Actions #5

Updated by Alexander Opitz over 9 years ago

  • Status changed from Needs Feedback to Closed

No feedback within the last 90 days => closing this issue.

If you think that this is the wrong decision or experience this issue again, then please write to the mailing list typo3.teams.bugs with issue number and an explanation or open a new ticket and add a relation to this ticket number.

Actions

Also available in: Atom PDF