diff options
| author | raul | 2014-06-30 16:48:40 +0200 |
|---|---|---|
| committer | raul | 2014-06-30 16:48:40 +0200 |
| commit | 64558106102ba145acda061a582ed3720823d8cc (patch) | |
| tree | 1a0a0ceb14105725d260506dc0425964dae20d72 /lang/dictionary.php | |
| parent | revert changes (diff) | |
| download | slx-admin-64558106102ba145acda061a582ed3720823d8cc.tar.gz slx-admin-64558106102ba145acda061a582ed3720823d8cc.tar.xz slx-admin-64558106102ba145acda061a582ed3720823d8cc.zip | |
[i18n]creation of the lang folder
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; + } + +} |
