예제 #1
0
파일: extractlng.php 프로젝트: demental/m
 public function execute($params)
 {
     $lang = $params[0];
     if (!in_array($lang, Config::getAllLangs())) {
         throw new Exception('Specified lang is not part of this project handled languages');
     }
     foreach (FileUtils::getAllFiles(APP_ROOT . 'app/' . APP_NAME) as $file) {
         $result = preg_match_all('`(?:__|_e)\\(\'(.+)\'(?:,array\\(.+\\))?\\)`sU', file_get_contents($file), $matches);
         foreach ($matches[1] as $elem) {
             $nbfound++;
             __(str_replace("\\'", "'", $elem));
         }
     }
     $arr = T::getInstance($lang)->getStrings();
     T::getInstance($lang)->save(true);
 }
예제 #2
0
파일: T.php 프로젝트: demental/m
 function __($string, $args = null)
 {
     $tr = T::getInstance();
     return $tr->translate($string, $args);
 }