Skip to content

Commit

Permalink
Updating l10n to use the new CakeRequest method.
Browse files Browse the repository at this point in the history
  • Loading branch information
markstory committed Nov 7, 2010
1 parent 22bb07a commit 09d3a06
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions cake/libs/l10n.php
Expand Up @@ -17,6 +17,7 @@
* @since CakePHP(tm) v 1.2.0.4116
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
App::import('Core', 'CakeRequest');

/**
* Localization
Expand Down Expand Up @@ -407,13 +408,8 @@ function __setLanguage($language = null) {
* @access private
*/
function __autoLanguage() {
$_detectableLanguages = preg_split('/[,;]/', env('HTTP_ACCEPT_LANGUAGE'));
$_detectableLanguages = CakeRequest::acceptLanguage();
foreach ($_detectableLanguages as $key => $langKey) {
$langKey = strtolower($langKey);
if (strpos($langKey, '_') !== false) {
$langKey = str_replace('_', '-', $langKey);
}

if (isset($this->__l10nCatalog[$langKey])) {
$this->__setLanguage($langKey);
return true;
Expand Down

0 comments on commit 09d3a06

Please sign in to comment.