public static function bindTranslator($app)
    {
        //1. Bind the translation line loader.
        static::bindLoader($app);

        //2. Bind the translator.
        $app->singleton('translator', function ($app) {
            // When registering the translator component, we'll need to set the default
            // locale as well as the fallback locale. So, we'll grab the application
            // configuration so we can easily get both of these values from there.
            $trans = new Translator(
                $app['translation.loader'], $app['config']['app.locale']
            );

            $trans->setFallback($app['config']['app.fallback_locale']);

            return $trans;
        });
    }
public static function bindTranslator($app)
    {
        //1. Bind the translation line loader.
        static::bindLoader($app);

        //2. Bind the translator.
        $app->singleton('translator', function ($app) {
            // When registering the translator component, we'll need to set the default
            // locale as well as the fallback locale. So, we'll grab the application
            // configuration so we can easily get both of these values from there.
            $trans = new Translator(
                $app['translation.loader'], $app['config']['app.locale']
            );

            $trans->setFallback($app['config']['app.fallback_locale']);

            return $trans;
        });
    }
public static function bindTranslator ( $ app ) { //1. Bind the translation line loader. static :: bindLoader ( $ app ) ; //2. Bind the translator. $ app -> singleton ( 'translator' , function ( $ app ) { // When registering the translator component, we'll need to set the default // locale as well as the fallback locale. So, we'll grab the application // configuration so we can easily get both of these values from there. $ trans = new Translator ( $ app [ 'translation.loader' ] , $ app [ 'config' ] [ 'app.locale' ] ) ; $ trans -> setFallback ( $ app [ 'config' ] [ 'app.fallback_locale' ] ) ; return $ trans ; } ) ; }
Bind the translator with app or ioc container.

@return void
Bind the translator with app or ioc container .