PHP Class Potsky\LaravelLocalizationHelpers\Factory\TranslatorMicrosoft

Inheritance: implements Potsky\LaravelLocalizationHelpers\Factory\TranslatorInterface
Exibir arquivo Open project: potsky/laravel-localization-helpers

Protected Properties

Property Type Description
$bingTranslator
$default_language

Public Methods

Method Description
__construct ( array $config )
translate ( string $word, string $toLang, null $fromLang = null ) : null | string

Method Details

__construct() public method

public __construct ( array $config )
$config array

translate() public method

public translate ( string $word, string $toLang, null $fromLang = null ) : null | string
$word string Sentence or word to translate
$toLang string Target language
$fromLang null Source language (if set to null, translator will try to guess)
return null | string The translated sentence or null if an error occurs

Property Details

$bingTranslator protected_oe property

protected $bingTranslator

$default_language protected_oe property

protected $default_language