- What does tomatophp/filament-translations-google do?
- It is a Filament plugin that extends Filament Translations Manager with Google Translate support. It lets you auto-translate Laravel __() and trans() strings from the Filament admin UI and save the results into your language files. It is intended for Laravel projects already using Filament for localization workflows.
- How do I install filament-translations-google in a Laravel app?
- First install and configure tomatophp/filament-translations, then run composer require tomatophp/filament-translations-google. After that run php artisan filament-translations-google:install and register FilamentTranslationsGooglePlugin::make() in your AdminPanelProvider. Publish the config or language assets if you need to customize them.
- Does this package require Filament Translations Manager?
- Yes. The README states that Translation Manager must be installed and configured before installing this package. This package is an extension, not a standalone translation manager. Without the base Translations Manager, the Google-powered workflow is not expected to work.
- Which Laravel and PHP versions does filament-translations-google support?
- The package targets Laravel 10+ and PHP 8.1+, based on the requirements of current Filament releases. You should confirm the exact constraints on Packagist before adding it to a production project. Projects on older Laravel or PHP versions may need to upgrade first.
- How do I configure the Google Translate API key?
- You need a Google Cloud Translate API key or credentials for the package to call Google translation services. Store the key securely in your .env file and publish the package config with php artisan vendor:publish --tag=filament-translations-google-config. Avoid committing credentials and use environment-specific keys where possible.
- Can it automatically translate Laravel __() and trans() strings?
- Yes. The package uses Google translation crawling to auto-translate strings managed through Filament Translations Manager. It is built to handle Laravel __() and trans() translation entries from the Filament admin panel. Review auto-generated translations before relying on them in production.
- What are the Google Translate API cost and rate limit risks?
- Google Translate API usage can incur costs once you exceed the free quota, so monitor character usage and set budget alerts. Google also enforces rate limits that can interrupt large translation jobs if they are not handled. For production, consider retry logic, queueing, and logging around API failures.
- How should I handle large translation batches with this package?
- The package supports bulk translation through Filament, but the assessment notes no explicit chunking or background processing. Large batches can hit Google API quotas or slow down the admin workflow. For heavy usage, translate in smaller chunks or wrap calls in queued jobs with retry handling.
- Can I test filament-translations-google in CI or mock Google API calls?
- The package includes a PEST test suite that you can run with composer test. Its own tests may cover package behavior, but the README does not document a Google API mocking strategy for application CI. In your app, mock the Google Translate client or HTTP calls so tests do not depend on live API credentials.
- Does it work without Filament or with DeepL and other translation services?
- No. It is designed as a Filament plugin and relies on Filament Translations Manager plus Google Translate. Projects not using Filament would need significant UI and workflow refactoring. Using DeepL, AWS Translate, or another provider would require customization or a different abstraction layer.