コード例 #1
0
 public function Translate($Code, $Default = False)
 {
     $this->EventArguments['Code'] = $Code;
     $this->FireEvent('BeforeTranslate');
     $Result = parent::Translate($Code, $Default);
     return $Result;
 }
コード例 #2
0
ファイル: class.developerlocale.php プロジェクト: TiGR/Addons
 public function Translate($Code, $Default = FALSE)
 {
     // Figure out where the translation was called.
     //      $Trace = debug_backtrace();
     //      $LastIndex = NULL;
     //      foreach ($Trace as $Index => $Item) {
     //         if (in_array(strtolower($Item['function']), array('t', 'translate'))) {
     //            $LastIndex = $Index;
     //            continue;
     //         } else {
     //            break;
     //         }
     //      }
     //      if (isset($Trace[$LastIndex])) {
     //         $TraceItem = $Trace[$LastIndex];
     //      }
     $Result = parent::Translate($Code, $Default);
     if ($Code) {
         $this->_CapturedDefinitions[$Code] = $Result;
     }
     return $Result;
 }
コード例 #3
0
 public function Translate($Code, $Default = FALSE)
 {
     $Result = parent::Translate($Code, $Default);
     if (!$Code || substr($Code, 0, 1) == '@') {
         return $Result;
     }
     $Prefix = self::GuessPrefix();
     if (!$Prefix) {
         return $Result;
     }
     if ($Prefix == 'unknown') {
         decho($Code);
         decho(debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS));
         die;
     }
     if (Gdn_Theme::InSection('Dashboard')) {
         $Prefix = 'dash_' . $Prefix;
     } else {
         $Prefix = 'site_' . $Prefix;
     }
     $this->_CapturedDefinitions[$Prefix][$Code] = $Result;
     return $Result;
 }