Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integration in CI #28

Open
khalyomede opened this issue Jan 22, 2022 · 1 comment
Open

Integration in CI #28

khalyomede opened this issue Jan 22, 2022 · 1 comment
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@khalyomede
Copy link

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
Copy link
Owner

amiranagram commented Jan 22, 2022

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!

@amiranagram amiranagram added enhancement New feature or request good first issue Good for newcomers labels Jan 22, 2022
@amiranagram amiranagram linked a pull request Jan 24, 2022 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants