andreazorzi/laravel-tolgee-translator
| Install | |
|---|---|
composer require andreazorzi/laravel-tolgee-translator |
|
| Latest Version: | 1.1.0 |
| PHP: | ^8.2 |
| Laravel: | 10 – 13 |
| License: | MIT |
| Last Updated: | Apr 24, 2026 |
| Links: | GitHub · Packagist |
Laravel Tolgee Translator
This package simplifies the integration of Toglee on Laravel by adding commands and blade directives.
Installation
composer require andreazorzi/laravel-tolgee-translator
Getting started
Config
/*
* Tolgee service host
*/
'host' => env('TOLGEE_HOST', 'https://app.tolgee.io'),
/**
* Your tolgee api key
*/
'api_key' => env('TOLGEE_API_KEY'),
/**
* Tolgee project id
*/
'project_id' => env('TOLGEE_PROJECT_ID'),
/**
* Default project language
*/
'locale' => env('TOLGEE_LOCALE', 'en'),
/**
* Overwrite base locale translations files.
*/
'override' => env('TOLGEE_OVERRIDE', false),
/**
* Accepted translation states. Check Tolgee documentation for available states.
* Ex: REVIEWED,DISABLED,UNTRANSLATED,TRANSLATED
*/
'accepted_states' => explode(",", env('TOLGEE_ACCEPTED_STATES', 'REVIEWED')),
/**
* Files to ignore during sync.
*/
'ignore_files' => explode(",", env('TOLGEE_IGNORE_FILES', '')),
/*
* Set a specific subfolder for language files
* Ex: app/lang/{locale}/tolgee -> "tolgee"
*/
'lang_subfolder' => env('TOLGEE_LANG_SUBFOLDER'),
/*
* Set a specific subfolder for language files
* Ex: app/lang/{locale}/tolgee -> "tolgee"
*/
'sync_on_production' => env('TOLGEE_SYNC_ON_PRODUCTION', false),
Commands
Export Keys
php artisan tolgee:export-keys
Export all project translations keys and save them into tolgee project, existing keys will not be overwritten.
Delete Keys
php artisan tolgee:delete-keys
Delete all keys from the tolgee project.
Sync Translations
php artisan tolgee:sync-translations
Sync the translations from Tolgee to your local project
Usage
To insert the translation into your project blade you can use the blade directive @tolgee($key)
@tolgee('pages.index.title')
If you want you can also get the translation by calling the the helper tolgee($key)
tolgee('pages.index.title');
Those methods return the string on production environment and a html string on local environment. The html string provide a direct link to the tolgee translation
Sync Button
It is possible to insert a button to update translations directly on the page under testing
<x-tolgee::sync-translations />
Related Packages
Powerful PHP database abstraction layer (DBAL) with many features for database s...
Laravel Serializable Closure provides an easy and secure way to serialize closur...
Version History
| Version | Released | PHP | Laravel | License |
|---|---|---|---|---|
| 1.1.0 | ^8.2 | ^10.0| | MIT | |
| 1.0.8 | ^8.2 | ^11.37 | MIT | |
| 1.0.7 | ^8.2 | ^11.37 | MIT | |
| 1.0.6 | ^8.2 | ^11.37 | MIT | |
| 1.0.5 | ^8.2 | ^11.37 | MIT | |
| 1.0.4 | ^8.2 | ^11.37 | MIT | |
| 1.0.3 | ^8.2 | ^11.37 | MIT | |
| 1.0.2 | ^8.2 | ^11.37 | MIT | |
| 1.0.1 | ^8.2 | ^11.37 | MIT | |
| 1.0.0 | ^8.2 | ^11.37 | MIT |