예제 #1
0
파일: Cache.php 프로젝트: codex73/LampCMS
 /**
  *
  * 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;
 }
예제 #2
0
 /**
  * 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];
 }