From 5472fd01bdb5640f58579fc06b0777e4f52975d7 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Thu, 7 Aug 2014 19:20:39 +0200 Subject: Some sanity checks; start making detection of available languages dynamic; put dictionary class in inc/; make redirection on language change work if browser doesn't send referer information --- inc/dictionary.inc.php | 82 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 82 insertions(+) create mode 100644 inc/dictionary.inc.php (limited to 'inc/dictionary.inc.php') diff --git a/inc/dictionary.inc.php b/inc/dictionary.inc.php new file mode 100644 index 00000000..58127c18 --- /dev/null +++ b/inc/dictionary.inc.php @@ -0,0 +1,82 @@ + $lang); + return array_merge($language, json_decode($content, true)); + } + + public static function translate($string) + { + $hardcoded = json_decode(file_get_contents("lang/" . LANG . "/messages-hardcoded.json"), true); + return $hardcoded[$string]; + } + + public static function getMessages() + { + return self::$messageArray; + } + + public static function getLanguages() + { + return self::$languages; + } + +} + +Dictionary::init(); -- cgit v1.2.3-55-g7522