Fix E_STRICT failure in i18n example.
This commit is contained in:
@@ -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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user