public static function generate($core, $lang) { $path = PATH; $translations = self::readFiles($path); $lng = new rifLng($lang); $poParser = $lng->getPoParser(); $poParser->resetEntries(); foreach ($translations as $translation) { $poParser->setEntry($translation->msgid, array('msgid' => $translation->msgid, 'msgstr' => $translation->msgstr), true); } $poParser->writeFile($path . "/app/translations/" . $lang . ".po"); }
public function framework(){ try{ $rifLng = new rifLng(LANG); $config = new rifConfig($rifLng); $hooks = new hooks($rifLng); $request = new rifRequest($rifLng); $routing = new rifRouting($rifLng, $request, $config->routes); $events = new rifEvent(); if($routing->hasError()){ rifException::routingException(array( 'message'=> $rifLng->__("Routing error : __err__",array("err"=>$routing->getError())) )); } $core = new rifCore($config,$rifLng, $routing, $hooks, $events); $instance = new rifInstance($core); $response = new rifResponse($core, $instance); }catch(rifExceptionCallable $e){ $error = new rifErr($e); if(isset($core->core['routing']) && $core->core['routing']->route['response'] === "json"){ rifException::JsonResponseException(array( 'message'=> $error->message )); }else{ print_R($error); } } }