Download the PHP package headwires/translator-client without Composer
On this page you can find all versions of the php package headwires/translator-client. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download headwires/translator-client
More information about headwires/translator-client
Files in headwires/translator-client
Package translator-client
Short Description Laravel client package for syncing translations from Headwires Translator CDN
License MIT
Informations about the package translator-client
Translator Client for Laravel
Laravel package for LangSyncer - live translation management without deployments.
Features
- Live Updates: Translation changes appear in your app within seconds
- Static Mode: Traditional file-based translations for full control
- Code Scanner: Find hardcoded strings in your codebase
- Multi-Project: Manage multiple translation projects in one app
- Webhooks: Auto-sync when translations change in LangSyncer
Requirements
- PHP 8.2+
- Laravel 10, 11, or 12
Installation
Publish the configuration:
Quick Start
Add to your .env:
Sync translations:
Done! Use Laravel's translation helpers as usual:
Configuration
Environment Variables
| Variable | Description | Default |
|---|---|---|
CLI_TRANSLATOR_API_KEY |
Your project API key from LangSyncer | required |
CLI_TRANSLATOR_CLIENT_MODE |
static, live, or auto |
static |
CLI_TRANSLATOR_SYNC_STRATEGY |
overwrite or merge |
overwrite |
CLI_TRANSLATOR_CLIENT_CACHE_TTL |
Cache TTL in seconds (live mode) | 3600 |
CLI_TRANSLATOR_CLIENT_WEBHOOK_ENABLED |
Enable webhook endpoint | true |
Client Modes
Static Mode (Default)
Translations saved as PHP files in resources/lang/. Best for production.
Live Mode
Translations loaded from cache, updated instantly via webhooks. Uses your project's configured cache driver.
Auto Mode
Automatically selects live mode for serverless (Vapor) or static mode otherwise.
Sync Strategies
Overwrite (Default)
Replaces local files completely. Use when LangSyncer is your source of truth.
Merge
Preserves local-only keys while updating from LangSyncer. CDN values take precedence for existing keys.
Commands
translator:sync
Download translations from LangSyncer:
translator:warmup
Pre-cache translations for live mode. Run during deployment:
translator:status
Check configuration and connection status:
Output:
translator:scan
Scan your codebase for hardcoded strings:
Scans .blade.php and .php files for text that should be translated.
translator:apply
Apply approved scanner suggestions and activate translations:
Multi-Project Setup
Configure multiple projects in config/translator-client.php:
Sync specific project:
Webhooks
The package automatically registers a webhook endpoint at /api/translator/webhook. Configure this URL in your LangSyncer project settings.
When translations are published in LangSyncer, the webhook triggers an automatic sync.
Customize the route:
Disable webhooks:
Deployment
Add to your deployment script:
Laravel Scheduler
Auto-sync translations:
File Structure
After syncing (static mode):
Note: Synced files include a warning header. Create separate files for local-only translations.
License
MIT
Support
- Documentation: langsyncer.com/documentation
- Issues: GitHub Issues
All versions of translator-client with dependencies
illuminate/support Version ^10.0|^11.0|^12.0
illuminate/http Version ^10.0|^11.0|^12.0
illuminate/console Version ^10.0|^11.0|^12.0
guzzlehttp/guzzle Version ^7.0