amiranagram / localizator

Scan your Laravel project and generate language files ready to translate in language(s) of choosing.
Other
229 stars 29 forks source link

Integration in CI #28

Open khalyomede opened 2 years ago

khalyomede commented 2 years ago

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.

amiranagram commented 2 years ago

Love the proposal. If you think you might be able to contribute feel free to PR.

Notes: