src/phpDocumentor/Translator/ServiceProvider.php
public function register(Application $app)
    {
        /** @var ApplicationConfiguration $config */
        $config = $app['config'];

        $app['translator.locale'] = $config->getTranslator()->getLocale();

        $app['translator'] = $app->share(
            function ($app) {
                $translator = new Translator();
                $translator->setLocale($app['translator.locale']);

                return $translator;
            }
        );
    }
public function register(Application $app)
    {
        /** @var ApplicationConfiguration $config */
        $config = $app['config'];

        $app['translator.locale'] = $config->getTranslator()->getLocale();

        $app['translator'] = $app->share(
            function ($app) {
                $translator = new Translator();
                $translator->setLocale($app['translator.locale']);

                return $translator;
            }
        );
    }
public function register ( Application $ app ) { /** @var ApplicationConfiguration $config */ $ config = $ app [ 'config' ] ; $ app [ 'translator.locale' ] = $ config -> getTranslator ( ) -> getLocale ( ) ; $ app [ 'translator' ] = $ app -> share ( function ( $ app ) { $ translator = new Translator ( ) ; $ translator -> setLocale ( $ app [ 'translator.locale' ] ) ; return $ translator ; } ) ; }
Registers the translator using the currently active locale.

@param Application $app
Registers the translator using the currently active locale .