transl-me / laravel-transl
Package for the Laravel translation management service : Transl.me
Requires
- php: ^8.1
- illuminate/contracts: ^10.0||^11.0
- spatie/laravel-package-tools: ^1.16
Requires (Dev)
- guzzlehttp/guzzle: ^7.8
- larastan/larastan: ^2.7
- laravel/pint: ^1.13
- nunomaduro/collision: ^8.1.1||^7.10.0
- orchestra/testbench: ^9.0.0||^8.22.0
- pestphp/pest: ^2.30
- pestphp/pest-plugin-laravel: ^2.2
- phpstan/extension-installer: ^1.3
- phpstan/phpstan-deprecation-rules: ^1.1
- phpstan/phpstan-phpunit: ^1.3
- phpunit/phpunit: ^10.5
README
This package allows for pushing and pulling your Laravel localized content (translation files by default) to Transl.me.
Tip
Transl is a platform for developers, product owners, managers and translators to easily manage and automate localized content in a Laravel application. Localisation shouldn't be a burden on developers, it should be a burden on us.
Installation
You can install the package via composer:
composer require transl-me/laravel-transl
You can publish the config file with:
php artisan vendor:publish --tag="transl-config"
You can check out what the contents of the published config file will be here: config/transl.php.
Usage (Available commands)
Init
A one time command that initializes the defined project (pushes the initial translation lines) on Transl.me.
php artisan transl:init
Check out the command's signature to learn more about it's possible options.
Push
Pushes the defined project's translation lines to Transl.me.
php artisan transl:push
Check out the command's signature to learn more about it's possible options.
Pull
Retrieves and stores the defined project's translation lines from Transl.me.
php artisan transl:pull
Note
Unfortunately, when using with local translation files, we cannot guarantee the preservation of the original language file's formatting. This is because the language file contents are sent and retreive as JSON to and from Transl through HTTP. Therefore, any dynamic content and variables inside your translation files will be evualuated before being sent to Transl. No formatting information is transfered. Upon retrieval, the file's contents are reconstructed without the previously lost formating informations.
Tip
Ensure any previous local changes are versioned.
Check out the command's signature to learn more about it's possible options.
Synch
Pulls then pushes the defined project's translation lines to Transl.me.
php artisan transl:synch
Note
Same as for the push command regarding the inability to reconstruct the translation file's original content formatting (when using with local translation files).
Tip
Ensure any previous local changes are versioned.
Check out the command's signature to learn more about it's possible options.
Analyse
Analyses the defined project's translation lines.
php artisan transl:analyse
Check out the command's signature to learn more about it's possible options.
Testing
composer test
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
If you're interested in contributing to the project, please read our contributing docs before submitting a pull request.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
License
Please see License File for more information.