/** * * Method for creating Translation object * * @param string $locale name of locate for this object * (for example 'en_CA' for Canada) * * @return \Lampcms\I18n\Translator */ protected function tr($locale) { d('$locale: ' . $locale); $this->aTags = array('tr'); $o = \Lampcms\I18n\Translator::factory($this, $locale); d('returning o: ' . get_class($o)); return $o; }
/** * Get Translator object for a locale * If it does not exist in translators array create a new one * otherwise reuse the existing one * * @param string $locale * * @return object of type \Lampcms\I18n\Translator */ public function getTranslator($locale) { $Cache = $this->getCache(); if (!array_key_exists($locale, $this->translators)) { $this->translators[$locale] = \Lampcms\I18n\Translator::factory($Cache, $locale); } return $this->translators[$locale]; }