예제 #1
0
 /**
  * Creates the language prefixes wich allows us 
  * to use the short :action and :controller translations
  *
  * @param string 		$action
  * @return void
  */
 protected function set_language_alias($action)
 {
     // create langugage aliases
     $name = explode('::', $this->name);
     if (isset($name[1])) {
         $prefix = $name[0] . '::';
         $name = $name[1];
     } else {
         $prefix = '';
         $name = $name[0];
     }
     if (empty($action)) {
         $action = static::$_default_action;
     }
     CCLang::alias(':controller', $prefix . 'controller/' . strtolower($name));
     CCLang::alias(':action', $prefix . 'controller/' . strtolower($name . '.' . $action));
 }
예제 #2
0
파일: CCLang.php 프로젝트: clancats/core
 /**
  * CCLang::alias tests
  */
 public function test_alias()
 {
     CCLang::set_current('en');
     CCLang::alias(':test', 'CCUnit::phpunit');
     $this->assertEquals('Welcome', __(':test.welcome'));
     $this->assertEquals('Hello John', __(':test.hello', array('name' => 'John')));
 }