mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-19 02:56:15 +00:00
Updating l10n to use the new CakeRequest method.
This commit is contained in:
parent
22bb07abb0
commit
09d3a0626a
1 changed files with 2 additions and 6 deletions
|
@ -17,6 +17,7 @@
|
||||||
* @since CakePHP(tm) v 1.2.0.4116
|
* @since CakePHP(tm) v 1.2.0.4116
|
||||||
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
|
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
|
||||||
*/
|
*/
|
||||||
|
App::import('Core', 'CakeRequest');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Localization
|
* Localization
|
||||||
|
@ -407,13 +408,8 @@ class L10n {
|
||||||
* @access private
|
* @access private
|
||||||
*/
|
*/
|
||||||
function __autoLanguage() {
|
function __autoLanguage() {
|
||||||
$_detectableLanguages = preg_split('/[,;]/', env('HTTP_ACCEPT_LANGUAGE'));
|
$_detectableLanguages = CakeRequest::acceptLanguage();
|
||||||
foreach ($_detectableLanguages as $key => $langKey) {
|
foreach ($_detectableLanguages as $key => $langKey) {
|
||||||
$langKey = strtolower($langKey);
|
|
||||||
if (strpos($langKey, '_') !== false) {
|
|
||||||
$langKey = str_replace('_', '-', $langKey);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (isset($this->__l10nCatalog[$langKey])) {
|
if (isset($this->__l10nCatalog[$langKey])) {
|
||||||
$this->__setLanguage($langKey);
|
$this->__setLanguage($langKey);
|
||||||
return true;
|
return true;
|
||||||
|
|
Loading…
Add table
Reference in a new issue