summaryrefslogtreecommitdiffstats
path: root/lang/dictionary.php
blob: 25f28a768d0e120e6deb47d2aa131a8c9baff128 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
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;
	}
	
}