Download the PHP package hyperlinkgroup/linguist without Composer
On this page you can find all versions of the php package hyperlinkgroup/linguist. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download hyperlinkgroup/linguist
More information about hyperlinkgroup/linguist
Files in hyperlinkgroup/linguist
Package linguist
Short Description A package to manage your translation files from Linguist
License MIT
Homepage https://github.com/hyperlinkgroup/linguist
Informations about the package linguist
Linguist Connector for Laravel
A package to help you manage your translation files with Linguist — A better way to manage your language files.
Installation
You can install the package via composer:
You can optionally publish the config file with:
Quick Start (Setup Wizard)
The easiest way to get started is using the interactive setup wizard:
This wizard will guide you through:
- API Token - Enter your Linguist API token
- Project Selection - Choose an existing project or create a new one
- Sync Mode - Select how you want to synchronize translations:
- Sync: Merge local and remote translations (two-way)
- Pull: Download from Linguist (overwrite local)
- Push: Upload local translations to Linguist
- Options - Configure setup preferences and optional auto-translation
Configuration
The published config file (config/linguist.php):
The setup wizard automatically writes these values to your .env file.
LINGUIST_URL should point to the versioned API base URL (for example https://api.your-domain.com/v2).
LINGUIST_API_TOKENS_URL is the URL opened when users follow the Linguist API settings link printed before the token prompt (clickable in terminals that support hyperlinks; otherwise the label is still shown as plain text).
LINGUIST_PULL_MINIFIED controls whether pulled translation files are written as minified JSON. Defaults to false (pretty-printed).
Commands
linguist:setup
Interactive wizard for initial setup and configuration. Handles project creation/selection, sync mode configuration, and API token management.
linguist:sync
Runs translation synchronization in one of three modes (sync, pull, push).
If run interactively, the command prompts for mode selection (same choices as setup).
For scheduler/non-interactive execution, the command defaults to sync mode unless you pass an explicit mode flag:
Alternatively, use the --mode option:
Mode-specific options:
--prune-remote-keys deletes remote keys that no longer exist locally before upload (sync mode).
--no-activate-missing-languages skips activating local languages that are not yet active in the remote project. Applies to all modes. If omitted, the command prompts interactively or activates automatically in non-interactive contexts.
--sync-source controls which side wins for existing keys in sync mode: remote (default) keeps the remote value, local overwrites with the local value.
Sync Modes
Sync Mode (Recommended)
Performs a two-phase sync:
- Uploads local keys first (
push) - Downloads the resulting remote state (
pull) into local files
Pull Mode
Downloads all translations from Linguist and overwrites local files:
- Fetches all active languages
- Downloads translation files
- Replaces local files entirely in Laravel native locale JSON format (
lang/en.json,lang/de.json, ...)
Push Mode
Uploads local translations to Linguist:
- Reads all local translation files
- Creates/updates keys on remote
- Preserves remote-only keys
Events
The package dispatches Laravel events after successful operations:
Hyperlinkgroup\Linguist\Events\SyncCompletedHyperlinkgroup\Linguist\Events\PullCompletedHyperlinkgroup\Linguist\Events\PushCompleted
Each event contains:
$projectSlug(string)$result(Hyperlinkgroup\Linguist\DTO\SyncResult)
Example listener:
Advanced Usage
Using Actions Directly
For custom implementations, you can call the provided actions directly:
Data Transfer Objects
The package provides typed DTOs for configuration:
Error Handling and Reporting
All sync operations return detailed SyncResult objects with:
- Per-language results: Success/failure status for each language
- Partial success detection: Identify which languages succeeded or failed
- Detailed error messages: Specific failure reasons per language
- Key counts: Total processed and failed key counts
Example output:
API Endpoints
The package communicates with Linguist's REST API (/v2):
GET /v2/projects- List available projectsPOST /v2/projects- Create new projectGET /v2/projects/{project}- Get project details (including source language)PATCH /v2/projects/{project}- Update projectGET /v2/projects/{project}/languages- List project languagesGET /v2/projects/{project}/export/json/{language}- Get export URLGET /v2/projects/{project}/translation-keys- List translation keysPOST /v2/projects/{project}/translation-keys- Create/update keyPATCH /v2/projects/{project}/translation-keys/{key}- Update keyDELETE /v2/projects/{project}/translation-keys/{key}- Delete keyPOST /v2/projects/{project}/translate- Trigger auto-translation
All endpoints require Bearer token authentication.
Testing
The test suite includes:
- Unit tests for actions and core orchestration logic
- DTO validation tests
- Legacy integration tests
- HTTP mocking for API interactions
License
The MIT License (MIT). Please see License File for more information.
All versions of linguist with dependencies
guzzlehttp/guzzle Version ^7.2
illuminate/contracts Version ^12.0|^13.0
lorisleiva/laravel-actions Version ^2.10
spatie/laravel-package-tools Version ^1.93