From 3f00f46bcdd7d4d93deecd62ec59405168123887 Mon Sep 17 00:00:00 2001 From: raul Date: Tue, 24 Jun 2014 11:58:54 -0300 Subject: [i18n] implemented translator logic --- dictionary.php | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'dictionary.php') diff --git a/dictionary.php b/dictionary.php index 9563f7c3..00834a49 100644 --- a/dictionary.php +++ b/dictionary.php @@ -1,14 +1,18 @@ dictionary = json_decode(file_get_contents("dictionary.json"),true); + function build(){ + self::$dictionary = json_decode(file_get_contents("dictionary.json"),true); + foreach(self::$dictionary as $key => $text){ + self::$langArray[$key] = $text[LANG]; + } } - - public function translate($text){ - return $this->dictionary[$text][LANG]; + public static function getArray(){ + return self::$langArray; } + } -- cgit v1.2.3-55-g7522