bambamboole / laravel-translation-dumper
A laravel package to dump missing translation keys into the translation files
Installs: 1 038
Dependents: 2
Suggesters: 0
Security: 0
Stars: 10
Watchers: 1
Forks: 0
Open Issues: 1
Requires
- php: ^8.1
- illuminate/support: ^8.0|^9.0|^10.0|^11.0
- illuminate/translation: ^8.0|^9.0|^10.0|^11.0
Requires (Dev)
- laravel/pint: ^1.8
- phpunit/phpunit: ^10.1
This package is auto-updated.
Last update: 2024-10-23 20:37:14 UTC
README
This package provides an option to extend Laravels Translator to write missing
translation keys to their respective translation files.
This is especially useful if you have dynamic translation keys where static dumpers do not work.
Installation
You can install the package via composer.
Since this package should only be used in development, you should add the --dev
flag.
composer require --dev bambamboole/laravel-translation-dumper
Usage
To enable the dumper, you have to set the environment variable `DUMP_TRANSLATIONS` to `true`.
Workflow
Just write your templates and use the __()
helper as usual with your preferred
translation key pattern. As soon as you visit the page, the missing translation keys,
they will be written to the respective translation files in the structure that the first
part of the key is the file name and the rest is the nested path of a PHP array.
As value it takes the translation key itself prefixed by a configurable prefix.
Testing
composer test
Contributing
Please see CONTRIBUTING for details.
Security
If you discover any security related issues, please email manuel@christlieb.eu instead of using the issue tracker.
Credits
License
The MIT License (MIT). Please see License File for more information.