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

CLI inlang machine translate command #760

Closed
3 tasks done
samuelstroschein opened this issue May 15, 2023 · 9 comments
Closed
3 tasks done

CLI inlang machine translate command #760

samuelstroschein opened this issue May 15, 2023 · 9 comments
Assignees
Labels
scope: inlang/cli Related to source-code/cli. type: feature New feature or request

Comments

@samuelstroschein
Copy link
Member

samuelstroschein commented May 15, 2023

Context

Users are requesting a machine translate command for the CLI that can be embedded in CI/CD.

Proposal

Have a machine translate command that:

  1. calls readResources to get all resources
  2. iterate over the resources and finds all messages that are missing (I propose to not rely on the missingMessages rule because not every project is 100% certain to use the missingMessages rule).
  3. machine translates all missing translations
  4. calls writeResources to persist updated resources

Blocked by

Tasks after complete

@jonator
Copy link
Contributor

jonator commented May 16, 2023

@samuelstroschein will be waiting for a PR. Would this use Google translate API?

@samuelstroschein
Copy link
Member Author

@jonator Yes, for now at least via our API keys (no need for you to set up anything)

@jonator
Copy link
Contributor

jonator commented May 16, 2023

Tagging @MaxMillington

@samuelstroschein
Copy link
Member Author

@jonator @MaxMillington @felixhaeberle is likely pushing out the feature tomorrow.

The command translates all missing translations for all languages. There are no filter options yet. Is that sufficient? Here is a sneak peek:

CleanShot 2023-05-16 at 19 40 38@2x

@jonator
Copy link
Contributor

jonator commented May 16, 2023

We also have a chaggpt API key we can pass instead of a google API key already.

Looking great @samuelstroschein ! Keep me posted

This will be me for now:
Screenshot 2023-05-16 at 3 45 28 PM

@felixhaeberle
Copy link
Contributor

@samuelstroschein Is there a mode needed where we "machine translate --hard" translate all messages, not respecting already translated keys? Could be with an additional prompt.

@samuelstroschein
Copy link
Member Author

@felixhaeberle please no --hard flag :D Replacing human reviewed (hopefully) translations with machine translation = bad.

@felixhaeberle
Copy link
Contributor

felixhaeberle commented May 17, 2023

@samuelstroschein unfortunately, we have to fix the env setup in prod #777 😅
I'll assign this to you for further coordination as I'm ooo in the next week.

@samuelstroschein
Copy link
Member Author

Fixed #777. @jonator PR is on my todo list for tomorrow in #782

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
scope: inlang/cli Related to source-code/cli. type: feature New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants