Fix E_STRICT failure in i18n example.

This commit is contained in:
Justin Hileman
2012-03-14 19:55:26 -07:00
parent 6c752e1955
commit 9693695d2b
+3 -3
View File
@@ -9,12 +9,12 @@ class I18n extends Mustache {
public $__ = array(__CLASS__, '__trans'); public $__ = array(__CLASS__, '__trans');
// A *very* small i18n dictionary :) // A *very* small i18n dictionary :)
private $dictionary = array( private static $dictionary = array(
'Hello.' => 'Hola.', 'Hello.' => 'Hola.',
'My name is {{ name }}.' => 'Me llamo {{ name }}.', 'My name is {{ name }}.' => 'Me llamo {{ name }}.',
); );
public function __trans($text) { public static function __trans($text) {
return isset($this->dictionary[$text]) ? $this->dictionary[$text] : $text; return isset(self::$dictionary[$text]) ? self::$dictionary[$text] : $text;
} }
} }