Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Google Translate Php Laravel Package

stichoza/google-translate-php

Free, unofficial Google Translate API client for PHP 8+. Translate text between languages with simple methods, auto language detection, supported languages list, parameter preservation, raw responses, custom URL/token generator, and configurable HTTP client.

View on GitHub
Deep Wiki
Context7
v5.2.0

What's Changed

New Contributors

Full Changelog: https://github.com/Stichoza/google-translate-php/compare/v5.1.4...v5.2.0

v5.1.4

What's Changed

New Contributors

Full Changelog: https://github.com/Stichoza/google-translate-php/compare/v5.1.3...v5.1.4

v5.1.3
  • Preserving Parameters Feature: Introducing the preserveParameters() method to preserve specific parameters during translation. Users can now retain placeholders like :name or :count within localization files or templating engines, preventing their translation. Usage can be found in preserving parameters section of documentation. - #199. Thanks @kylemilloy 🎉
v5.1.0

As of v5.1.0 concrete exceptions are available in \Stichoza\GoogleTranslate\Exceptions namespace:

  • LargeTextException If the requested text is too large to translate.
  • RateLimitException If Google has blocked you for excessive amount requests.
  • TranslationRequestException If any other HTTP related error occurs during translation.
  • TranslationDecodingException If the response JSON cannot be decoded.

All concrete exceptions are backwards compatible, so if you were using older versions, you won't have to update your code.

TranslationDecodingException extends UnexpectedValueException, while LargeTextException, RateLimitException and TranslationRequestException extend ErrorException that was used in older versions (<5.1.0) of this package.

Finally a good answer to #70

v5.0.1

Updated package to require PHP 8 as PHP 7.4 reached its end of life yesterday.

  • setOptions() method accepts only arrays, parameter is not nullable anymore. Likelihood of impact in low.
  • Updated PHPUnit and GuzzleHttp dependencies.
  • All properties and parameters are typed.
  • Various bugfixes and improvements.
v4.1.5
  • Switched from webapp client to gtx for better quality of translation. #163, Thanks @henno
  • Added setClient() method to switch between gtx and webapp clients (Default is gtx).
v4.1.4

Preserve HTTP error codes in ErrorException #160 #161

v4.1.2

Add PHP 8 Support

v4.1.0
  • Nullable return types
v3.2.15

Fixes errors on old version. Please upgrade to new version of this package tho, 3.2 is not supported.

v4.0.0

This is a major update. Please read docs before updating from v3.2 to v4.0.

  • PHP 7.1 or later is required.
  • Renamed class from TranslateClient to simply GoogleTranslate.
  • Removed array translation which was not working (might add later).
  • Changed signatures of methods (see docs).
  • Separate static trans() and non-static translate() methods.
  • Updated dependencies.
  • Various bugfixes.
v3.2.1
  • Added multiple sentence translation using array (see updated docs).
  • Minimum required PHP is >=5.5.0.
  • Moved to Guzzle ~6.0.
v3.1.1
  • Language detection is not experimental feature now.
  • getLastDetectedSource() can be called both statically and non-statically.
  • Added third parameter $options for advanced configuration of Guzzle HTTP client. (@vkollin)
  • Switched to PSR-2 coding style. (@subsan)
v3.0.1
  • Implemented getLastDetectedSource()
  • Bugfixes and improvements
v3.0.0

Totally refacted the whole code.

Readme and docs soming soon

v2.0.3

Fixed PSR-4 support

v2.0.0

This package has been added to Composer package manager :sunglasses: See the readme for installation instructions.

v1.3.0
  • Multiple sentence translation
  • Minor bugfixes
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
davejamesmiller/laravel-breadcrumbs
artisanry/parsedown
christhompsontldr/phpsdk
enqueue/dsn
bunny/bunny
enqueue/test
enqueue/null
enqueue/amqp-tools
milesj/emojibase
bower-asset/punycode
bower-asset/inputmask
bower-asset/jquery
bower-asset/yii2-pjax
laravel/nova
spatie/laravel-mailcoach
spatie/laravel-superseeder
laravel/liferaft
nst/json-test-suite
danielmiessler/sec-lists
jackalope/jackalope-transport