Skip to content
Permalink
Browse files

Updating l10n to use the new CakeRequest method.

  • Loading branch information...
markstory committed Nov 7, 2010
1 parent 22bb07a commit 09d3a0626a77e8ca1a71eee870c430ffc2be79ce
Showing with 2 additions and 6 deletions.
  1. +2 −6 cake/libs/l10n.php
@@ -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
@@ -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;

0 comments on commit 09d3a06

Please sign in to comment.
You can’t perform that action at this time.