nowo-tech / google-translate-php-bundle
Symfony bundle wrapping stichoza/google-translate-php with named profiles, FrankenPHP worker-safe reset, and configurable HTTP timeouts.
Package info
github.com/nowo-tech/GoogleTranslatePhpBundle
Type:symfony-bundle
pkg:composer/nowo-tech/google-translate-php-bundle
Fund package maintenance!
Requires
- php: >=8.2 <8.6
- psr/log: ^1.1 || ^2.0 || ^3.0
- stichoza/google-translate-php: ^5.1
- symfony/config: ^6.4 || ^7.4 || ^8.0
- symfony/dependency-injection: ^6.4 || ^7.4 || ^8.0
- symfony/http-kernel: ^6.4 || ^7.4 || ^8.0
- symfony/service-contracts: ^2.5 || ^3.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.0
- igor-php/igor-php: ^0.10.0
- nowo-tech/phpstan-frankenphp: ^1.0
- phpstan/extension-installer: ^1.4
- phpstan/phpstan: ^2.0
- phpstan/phpstan-phpunit: ^2.0
- phpstan/phpstan-symfony: ^2.0
- phpunit/phpunit: ^10.0 || ^11.0
- rector/rector: ^2.0
- symfony/console: ^6.4 || ^7.4 || ^8.0
- symfony/framework-bundle: ^6.4 || ^7.4 || ^8.0
- symfony/messenger: ^6.4 || ^7.4 || ^8.0
- symfony/yaml: ^6.4 || ^7.4 || ^8.0
Suggests
- nowo-tech/translation-yaml-tools-bundle: Official Google Cloud / DeepL / LibreTranslate backends for YAML catalogues
- psr/cache: To cache translations per profile (cache_pool option)
- symfony/flex: For automatic recipe installation
Provides
None
Conflicts
None
Replaces
None
- dev-main
- v1.4.1
- v1.4.0
- v1.3.1
- v1.3.0
- v1.2.3
- v1.2.2
- v1.2.1
- v1.2.0
- v1.1.2
- v1.1.1
- v1.1.0
- v1.0.8
- v1.0.7
- v1.0.6
- v1.0.5
- v1.0.4
- v1.0.3
- v1.0.2
- v1.0.1
- v1.0.0
- dev-fix/demo-csrf
- dev-chore/demo-uikit-formkit
- dev-fix/console-boundary-counter
- dev-docs/worker-audit-1.4.0
- dev-feat/arch-001-b6
- dev-fix/worker-state-a3
- dev-chore/symfony-security-2026-11-04
This package is auto-updated.
Last update: 2026-11-13 17:26:29 UTC
README
⭐ Found this useful? Install from Packagist · Give it a star on GitHub so more developers can find it.
Symfony bundle wrapping stichoza/google-translate-php with named profiles, configurable HTTP timeouts, and FrankenPHP worker compatibility (ResetInterface).
This bundle is FrankenPHP worker mode friendly.
Features
- Named profiles (
default_profile+profiles) for target/source languages, Guzzle timeouts, client, URL, andpreserve_parameters. - Worker-safe translator: clears mutable state between requests, Messenger messages and console commands under FrankenPHP worker / long-running PHP — including when the kernel is kept alive and the services resetter does not run (
ResetTranslatorsOnRequestSubscriber). - Defensive
extractParameters(): per-call placeholder counter (no reliance on upstreamstatic $index). - REQ-RUNTIME-001 timeouts:
timeout+connect_timeouton every profile.
Version policy
The Composer package name is nowo-tech/google-translate-php-bundle. Source code and issues are in the GitHub repository nowo-tech/GoogleTranslatePhpBundle.
We follow Semantic Versioning. See Changelog for release notes. Security support by major version is described in the Security policy.
Quick example
# config/packages/nowo_google_translate_php.yaml nowo_google_translate_php: default_profile: default profiles: default: target: es timeout: 10.0 connect_timeout: 5.0
use Nowo\GoogleTranslatePhpBundle\Contract\GoogleTranslatorInterface; final class MyService { public function __construct( private readonly GoogleTranslatorInterface $translator, ) { } public function run(string $text): ?string { return $this->translator->translateTo($text, 'es'); } }
Standard Symfony hosts and DDD / hexagonal hosts (domain port implemented on GoogleTranslatorInterface, bundle
exceptions only): see USAGE — Inject the translator.
Requirements
- PHP >= 8.2, < 8.6
- Symfony 6.4, 7.4, 8.0, or 8.1 (see
composer.json; CI exercises 6.4, 7.4, 8.0, and 8.1) stichoza/google-translate-php^5.1
Disclaimer
Upstream scrapes Google Translate (unofficial). Prefer Cloud Translation / DeepL / LibreTranslate for production. See also nowo-tech/translation-yaml-tools-bundle.
Documentation
- Installation
- Configuration
- Usage
- Contributing
- Code of Conduct
- Changelog
- Upgrading
- Release
- Security
- Engram
- Spec-driven development
- GitHub Spec Kit
Additional documentation
- PSR evaluation (REQ-CS-007)
- Demo (Symfony 8) — run
make -C demo up-symfony8from the bundle root. - Demo with FrankenPHP (development and production)
- FrankenPHP worker audit (kernel not reset)
- GitHub Actions CI requirements
Tests and coverage
- Tests: PHPUnit (PHP)
- PHP: 100%
- TS/JS: N/A
- Python: N/A
License
MIT. See LICENSE.
