protected static function translator()
    {
        if (static::$translator === null) {
            $translator = new Translator('en');
            $translator->addLoader('array', new ArrayLoader());
            static::$translator = $translator;
            static::setLocale('en');
        }

        return static::$translator;
    }
protected static function translator()
    {
        if (static::$translator === null) {
            $translator = new Translator('en');
            $translator->addLoader('array', new ArrayLoader());
            static::$translator = $translator;
            static::setLocale('en');
        }

        return static::$translator;
    }
protected static function translator ( ) { if ( static :: $ translator === null ) { $ translator = new Translator ( 'en' ) ; $ translator -> addLoader ( 'array' , new ArrayLoader ( ) ) ; static :: $ translator = $ translator ; static :: setLocale ( 'en' ) ; } return static :: $ translator ; }
Intialize the translator instance if necessary.

@return TranslatorInterface
Intialize the translator instance if necessary .