public static function trans(string $string, string $target = 'en', string $source = null, array $options = [], TokenProviderInterface $tokenProvider = null)
    {
        return (new self)
            ->setTokenProvider($tokenProvider ?? new GoogleTokenGenerator)
            ->setOptions($options) // Options are already set in client constructor tho.
            ->setSource($source)
            ->setTarget($target)
            ->translate($string);
    }
public static function trans(string $string, string $target = 'en', string $source = null, array $options = [], TokenProviderInterface $tokenProvider = null)
    {
        return (new self)
            ->setTokenProvider($tokenProvider ?? new GoogleTokenGenerator)
            ->setOptions($options) // Options are already set in client constructor tho.
            ->setSource($source)
            ->setTarget($target)
            ->translate($string);
    }
public static function trans ( string $ string , string $ target = 'en' , string $ source = null , array $ options = [ ] , TokenProviderInterface $ tokenProvider = null ) { return ( new self ) -> setTokenProvider ( $ tokenProvider ?? new GoogleTokenGenerator ) -> setOptions ( $ options ) // Options are already set in client constructor tho. -> setSource ( $ source ) -> setTarget ( $ target ) -> translate ( $ string ) ; }
Override translate method for static call.

@param string $string
@param string $target
@param string|null $source
@param array $options
@param TokenProviderInterface|null $tokenProvider
@return null|string
@throws ErrorException If the HTTP request fails
@throws UnexpectedValueException If received data cannot be decoded
Override translate method for static call .