diff options
| author | raul | 2014-06-30 16:48:40 +0200 |
|---|---|---|
| committer | Michael Pereira Neves | 2014-07-11 15:03:22 +0200 |
| commit | 07839c3c65cac3dbeb80cb40702667f4c21bdf13 (patch) | |
| tree | d906f2a03bfda544807bf294b4cb312893a229c5 /lang/dictionary.php | |
| parent | revert changes (diff) | |
| download | slx-admin-07839c3c65cac3dbeb80cb40702667f4c21bdf13.tar.gz slx-admin-07839c3c65cac3dbeb80cb40702667f4c21bdf13.tar.xz slx-admin-07839c3c65cac3dbeb80cb40702667f4c21bdf13.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; + } + +} |
