setTranslator() 공개 정적인 메소드

Set the Translator implementation.
public static setTranslator ( Symfony\Component\Translation\TranslatorInterface $translator )
$translator Symfony\Component\Translation\TranslatorInterface
예제 #1
0
 public function testGetsAndSetsTranslator()
 {
     $translator = new Translator();
     $this->assertNotEquals($translator, Date::getTranslator());
     Date::setTranslator($translator);
     $this->assertEquals($translator, Date::getTranslator());
 }
 /**
  * Bootstrap the application events.
  *
  * @return void
  */
 public function boot()
 {
     // Laravel 5 resource registration
     if (method_exists($this, 'loadTranslationsFrom')) {
         $this->loadTranslationsFrom($this->app->basePath() . '/vendor/jenssegers/date/src/lang', 'date');
     } else {
         if (method_exists($this, 'package')) {
             $this->package('jenssegers/date');
         }
     }
     // Use the Laravel translator.
     Date::setTranslator($this->app['translator']);
 }
예제 #3
0
 /**
  * Bootstrap the application events.
  *
  * @return void
  */
 public function boot()
 {
     $this->package('jenssegers/date');
     // Use the Laravel translator.
     Date::setTranslator($this->app['translator']);
 }