Beispiel #1
0
 public function action_view()
 {
     $id = $this->request->param('id', 0);
     $item = ORM::factory('First', $id);
     if (!$item->loaded()) {
         throw new HTTP_Exception_404();
     }
     $this->set('item', $item);
     $this->add_cumb(Kohana_I18n::get('Хроника деятельности Первого Президента'), 'first');
     $this->add_cumb($item->title, '');
 }
Beispiel #2
0
 /**
  * Get value from db table
  * @param string $string
  * @param string $lang
  * @return string 
  */
 public static function get($string, $lang = null)
 {
     if (Kohana::$environment == Kohana::DEVELOPMENT) {
         if (!$lang) {
             // Use the global target language
             $lang = I18n::$lang;
         }
         // Load the translation table for this language
         $table = I18n::load($lang);
         // Return the translated string if it exists
         return isset($table[I18n::$view . '|' . $string]) ? $table[I18n::$view . '|' . $string] : I18n::add($string);
     } else {
         return parent::get($string, $lang);
     }
 }