![]() LargeTextException If the requested text is too large to translate.UnexpectedValueException If data received from Google cannot be decoded.Īs of v5.1.0 concrete exceptions are available in \Stichoza\GoogleTranslate\Exceptions namespace:.ErrorException If the HTTP request fails for some reason.Static method trans() and non-static translate() and getResponse() methods will throw following exceptions: ![]() For example if you want to use older version of translation algorithm, type $tr->setClient('webapp')->translate('lorem ipsum.'). You can use ->setClient() method to switch between clients. First it was set to webapp but later google added gtx value which results in a better translation quality in terms of grammar and overall meaning of sentences. Google Translate has a parameter named client which defines quality of translation. $tr-> setTokenProvider( new MyTokenGenerator) Translation Client (Quality)
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |