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

Skip to content
Closed
Changes from 1 commit
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
Next Next commit
Improve preferred language detection
  • Loading branch information
mweimerskirch authored and jfsimon committed Mar 14, 2013
commit 598e4c83f132cb635970e1c31194d634e8d79bd2
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