Skip to content
This repository
Browse code

Fix comment in I18n

Move construction details to a protected constructor.
Fixes #2222
  • Loading branch information...
commit cd81f9c30abad0199577c8336bc4ca1212628759 1 parent bfd95d0
Mark Story authored November 05, 2011

Showing 1 changed file with 11 additions and 3 deletions. Show diff stats Hide diff stats

  1. 14  lib/Cake/I18n/I18n.php
14  lib/Cake/I18n/I18n.php
@@ -39,9 +39,9 @@
39 39
 class I18n {
40 40
 
41 41
 /**
42  
- * Instance of the I10n class for localization
  42
+ * Instance of the L10n class for localization
43 43
  *
44  
- * @var I10n
  44
+ * @var L10n
45 45
  */
46 46
 	public $l10n = null;
47 47
 
@@ -92,6 +92,15 @@ class I18n {
92 92
 	);
93 93
 
94 94
 /**
  95
+ * Constructor, use I18n::getInstance() to get the i18n translation object.
  96
+ *
  97
+ * @return void
  98
+ */
  99
+	protected function __construct() {
  100
+		$this->l10n = new L10n();
  101
+	}
  102
+
  103
+/**
95 104
  * Return a static instance of the I18n class
96 105
  *
97 106
  * @return I18n
@@ -100,7 +109,6 @@ public static function &getInstance() {
100 109
 		static $instance = array();
101 110
 		if (!$instance) {
102 111
 			$instance[0] = new I18n();
103  
-			$instance[0]->l10n = new L10n();
104 112
 		}
105 113
 		return $instance[0];
106 114
 	}

0 notes on commit cd81f9c

Please sign in to comment.
Something went wrong with that request. Please try again.