Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Improve preferred language detection
  • Loading branch information
mweimerskirch committed Jan 31, 2013
commit 3b2600ef2e51378435ef79d324bee22217e68901
3 changes: 3 additions & 0 deletions src/Symfony/Component/HttpFoundation/Request.php
Original file line number Diff line number Diff line change
Expand Up @@ -1309,6 +1309,9 @@ public function getLanguages()
for ($i = 0, $max = count($codes); $i < $max; $i++) {
if ($i == 0) {
$lang = strtolower($codes[0]);
if(!in_array($lang, $this->languages) {
$this->languages[] = $lang;
}
} else {
$lang .= '_'.strtoupper($codes[$i]);
}
Expand Down