mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-18 18:46:17 +00:00
Changed Configure::read() so it would return null if key is not set.
Refactored I18n and I10n classes. Removing languages that are not found in browsers git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@4117 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
parent
78df4e3549
commit
90a78232ed
3 changed files with 311 additions and 1101 deletions
|
@ -162,9 +162,15 @@ class Configure extends Object {
|
|||
|
||||
$name = $_this->__configVarNames($var);
|
||||
if(count($name) > 1){
|
||||
return $_this->{$name[0]}[$name[1]];
|
||||
if(isset($_this->{$name[0]}[$name[1]])) {
|
||||
return $_this->{$name[0]}[$name[1]];
|
||||
}
|
||||
return null;
|
||||
} else {
|
||||
return $_this->{$name[0]};
|
||||
if(isset($_this->{$name[0]})) {
|
||||
return $_this->{$name[0]};
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
/**
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
* @link http://www.cakefoundation.org/projects/info/cakephp CakePHP Project
|
||||
* @package cake
|
||||
* @subpackage cake.cake.libs
|
||||
* @since CakePHP v 1.2.0.4114
|
||||
* @since CakePHP v 1.2.0.4116
|
||||
* @version $Revision$
|
||||
* @modifiedby $LastChangedBy$
|
||||
* @lastmodified $Date$
|
||||
|
@ -93,10 +93,12 @@ class I18n extends Object {
|
|||
*/
|
||||
function translate($message, $message2 = null, $domain = null, $category = null, $count = null, $directory) {
|
||||
$_this =& I18n::getInstance();
|
||||
$language = Configure::read('Config.language');
|
||||
|
||||
if(!empty($_SESSION['Config']['locale'])) {
|
||||
$_this->locale = $_SESSION['Config']['locale'];
|
||||
} else {
|
||||
} else{
|
||||
$_this->__l10n->get($language);
|
||||
$_this->locale = $_this->__l10n->locale;
|
||||
}
|
||||
|
||||
|
|
1396
cake/libs/l10n.php
1396
cake/libs/l10n.php
File diff suppressed because it is too large
Load diff
Loading…
Add table
Reference in a new issue