Skip to content

A laravel package to automatically dump missing keys into the translation files

License

Notifications You must be signed in to change notification settings

bambamboole/laravel-translation-dumper

Repository files navigation

Laravel Translation Dumper

Latest Version on Packagist Total Downloads GitHub Actions codecov

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.

About

A laravel package to automatically dump missing keys into the translation files

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages