pezhvak / laravel-translator
A package to finally be able to localize projects without worrying about updating strings.
Requires
- php: ^8.1
- deeplcom/deepl-php: ^v0.4.0
- illuminate/contracts: ^9.0|^10.0
- spatie/laravel-package-tools: ^1.9.2
Requires (Dev)
- phpunit/phpunit: ^9.5
This package is auto-updated.
Last update: 2024-10-27 21:14:31 UTC
README
Installation
You can install the package via composer:
composer require pezhvak/laravel-translator
You can publish the config file with:
php artisan vendor:publish --tag="laravel-translator-config"
make sure you add these environment variables to your .env
file.
DEEPL_AUTH_KEY=<put your deepl token here>
Usage
First migrate the database:
php artisan migrate
Now you can run the following command to detect changes and translate strings:
php artisan translator:translate
Sometimes you want to translate only few locales, you can do this by providing them in the first parameter (separate them by comma if you want to provide multiple locales):
php artisan translator:translate en,fa
If you add a new locale, it won't get translated since there is no changed string in the default language, to do this force the translation:
php artisan translator:translate [new_locale] --force
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
License
The MIT License (MIT). Please see License File for more information.