Метод | Описание | |
---|---|---|
__call ( $name, $args ) | Override translate method for instance call. | |
__callStatic ( $name, $args ) | Override translate method for static call. | |
__construct ( string $source = null, string $target = 'en', array $options = [], Stichoza\GoogleTranslate\Tokens\TokenProviderInterface $tokener = null ) | Class constructor. | |
setHttpOption ( array $options ) : |
Set guzzleHttp client options. | |
setSource ( string $source = null ) : |
Set source language we are transleting from. | |
setTarget ( string $target ) : |
Set translation language we are transleting to. |
Метод | Описание | |
---|---|---|
checkStaticInstance ( ) : void | Check if static instance exists and instantiate if not. | |
getResponse ( string | array $data ) : array | Get response array. | |
instanceTranslate ( string | array $data ) : string | boolean | Translate text. | |
isValidLocale ( string $lang ) : boolean | Check if given locale is valid. | |
staticGetLastDetectedSource ( ) : string | boolean | Get last detected language. | |
staticTranslate ( string $source, string $target, string $string ) : string | boolean | Translate text statically. |
public __call ( $name, $args ) |
public static __callStatic ( $name, $args ) |
public __construct ( string $source = null, string $target = 'en', array $options = [], Stichoza\GoogleTranslate\Tokens\TokenProviderInterface $tokener = null ) | ||
$source | string | Source language (Optional) |
$target | string | Target language (Optional) |
$options | array | Associative array of http client configuration options (Optional) |
$tokener | Stichoza\GoogleTranslate\Tokens\TokenProviderInterface |
public setHttpOption ( array $options ) : |
||
$options | array | guzzleHttp client options. |
Результат |