Beispiel #1
0
 /**
  * Lädt die entsprechende Datei und fügt sie zur "Datenbank" hinzu
  *
  * @param	string	$file			Der Dateipfad ohne .json ende
  * @param	bool	$defaultLang	Zur Normalen Sprache oder zur Defaultsprache
  *
  */
 public static function loadLang($file, $defaultLang = false)
 {
     $file = file_get_contents($file);
     // Alle Kommentare löschen (mit Raute beginnen
     $file = preg_replace("/#\\s*([a-zA-Z ]*)/", "", $file);
     $array = json_decode($file, true);
     if (!$defaultLang) {
         self::$langs = array_merge((array) $array, self::$langs);
     } else {
         self::$default = array_merge((array) $array, self::$default);
     }
 }
Beispiel #2
0
 public static function loadLang($file, $defaultLang = false)
 {
     $file = file_get_contents($file);
     $file = preg_replace("/#\\s*([a-zA-Z ]*)/", "", $file);
     $array = json_decode($file, true);
     if (!$defaultLang) {
         self::$langs = array_merge((array) $array, self::$langs);
     } else {
         self::$default = array_merge((array) $array, self::$default);
     }
     return self::$langs = $array;
 }