diff options
Diffstat (limited to 'lang/dictionary.php')
-rw-r--r-- | lang/dictionary.php | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/lang/dictionary.php b/lang/dictionary.php new file mode 100644 index 00000000..25f28a76 --- /dev/null +++ b/lang/dictionary.php @@ -0,0 +1,28 @@ +<?php + +class Dictionary{ + private static $dictionary; + private static $langArray; + private static $messageArray; + + function build(){ + self::$dictionary = json_decode(file_get_contents("lang/dictionary.json"),true); + foreach(self::$dictionary as $key => $text){ + self::$langArray[$key] = $text[LANG]; + } + self::$messageArray = json_decode(file_get_contents("lang/".LANG."/messages.json"),true); + } + + public static function getArray(){ + return self::$langArray; + } + + public static function translate($string){ + return self::$langArray[$string]; + } + + public static function getMessages(){ + return self::$messageArray; + } + +} |