localizator
localizator copied to clipboard
Integration in CI
Description
First of all, thanks a lot for this package, it saved me tons of time!
I was wondering if the command could be used on a CI, and would fail (e.g. return a non 0 code) if it finds new keys to translate, without adding them.
Proposal
The command signature could be (to discuss):
php artisan localize fr --dry-run --ci
--dry-run
would instruct it to return the number of untranslated terms found by comparing what is already inside json/php files, and what the command was about to add. So the command will not really add the terms, just show what it is about to add.
--ci
would return a non 0 code if some translations have been added (if not using in pair with --dry-run
), or if some translations would have been added (if used with --dry-run
). In this case we could prevent deploying in production pages not fully translated (at least I would use it all the times).
Notes
I could give it a try if you find this feature useful to add to the package.
Love the proposal. If you think you might be able to contribute feel free to PR.
Notes:
- Separate PRs for
--dry-run
and--ci
-
--dry-run
should maybe output all untranslated keys in console, together with the count -
--ci
is good, needs to fail with return code 1 if untranslated strings are found, together with an outputted message in console - Tests!