google/cloud-translate
Idiomatic PHP client for Google Cloud Translation, part of Google Cloud PHP. Integrates translation service programmatically, dynamically translating text between thousands of language pairs. Install via Composer (google/cloud-translate). GA, with authentication guides and API docs.
Architecture fit
TranslationServiceClient), not a Laravel package. There is no service provider, config stub, facade, queue integration, or cache layer. Those are all yours to build.TranslationGateway interface → GoogleTranslationAdapter → TranslationServiceClient. That keeps the vendor boundary in one class and makes swapping (or faking) tractable.Google\Cloud\Translate\V3\Client\TranslationServiceClient, AdaptiveMtDataset, GetAdaptiveMtDatasetRequest). The v2 surface still exists in the same package. Decide the API version up front — most tutorials you'll find are V2 and won't map.Integration feasibility
composer require google/cloud-translate; auth via Application Default Credentials or a service account. Time-to-first-call is a single spike.ext-grpc) is optional but worth enabling for latency and connection reuse; REST fallback keeps CI and local dev simple.Technical risk
google/cloud-storage, Firebase, or Analytics in the same app, run composer why google/protobuf and pin deliberately; a transitive protobuf conflict is the most likely integration failure.MIGRATING.md only landed in v2.3.1 — upgrade docs lagged the break. Treat 2.x minors as safe per the GA pledge, majors as a scheduled migration.credentials client option. Plan on ADC/env-based auth rather than in-code credential injection; don't let it harden into your adapter's constructor.google-cloud-php monorepo, and most consumers depend on the metapackage. Read this as "no proven community Laravel wrapper to lean on," not "unused."Key questions
translateText only, or glossary, AdaptiveMT, transliteration/romanization, batch document translation, AutoML custom models?ext-grpc available in our production/queue images, or are we REST-only?Stack fit
config/services.php entry, binding in a service provider, an Http-style timeout/retry policy, a TranslationService domain contract, and a FakeTranslation test double. The fake matters more than usual — there is no offline mode, so every test otherwise hits a billable endpoint.config/*.php committed values. The package's own docs carry a warning against accepting untrusted credentials — mirror that in your adapter.Migration path
stichoza/google-translate-php): implement the same interface, run both, diff output on a sample, then flip. The scraping path is brittle and ToS-fragile; this is the supported route.MIGRATING.md and the php-docs-samples translate directory are the references.Compatibility
google/* packages is the one compatibility check worth automating in CI.Sequencing
translateText call + ApiException handling proven.Maintenance
Support
Scaling
Failure modes
googleapis.com → firewall allowlist and timeout budgets per call.Ramp-up
How can I help you explore Laravel packages today?