public function Translate($Code, $Default = False) { $this->EventArguments['Code'] = $Code; $this->FireEvent('BeforeTranslate'); $Result = parent::Translate($Code, $Default); return $Result; }
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; }
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; }