From cd81f9c30abad0199577c8336bc4ca1212628759 Mon Sep 17 00:00:00 2001 From: mark_story Date: Sat, 5 Nov 2011 08:19:57 -0400 Subject: [PATCH] Fix comment in I18n Move construction details to a protected constructor. Fixes #2222 --- lib/Cake/I18n/I18n.php | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/lib/Cake/I18n/I18n.php b/lib/Cake/I18n/I18n.php index e28e0a65d..2e8df40cb 100644 --- a/lib/Cake/I18n/I18n.php +++ b/lib/Cake/I18n/I18n.php @@ -39,9 +39,9 @@ if (function_exists('mb_internal_encoding')) { class I18n { /** - * Instance of the I10n class for localization + * Instance of the L10n class for localization * - * @var I10n + * @var L10n */ public $l10n = null; @@ -91,6 +91,15 @@ class I18n { 'LC_ALL', 'LC_COLLATE', 'LC_CTYPE', 'LC_MONETARY', 'LC_NUMERIC', 'LC_TIME', 'LC_MESSAGES' ); +/** + * Constructor, use I18n::getInstance() to get the i18n translation object. + * + * @return void + */ + protected function __construct() { + $this->l10n = new L10n(); + } + /** * Return a static instance of the I18n class * @@ -100,7 +109,6 @@ class I18n { static $instance = array(); if (!$instance) { $instance[0] = new I18n(); - $instance[0]->l10n = new L10n(); } return $instance[0]; }