crowdin / crowdin-cli

A command-line client for the Crowdin API
https://crowdin.github.io/crowdin-cli
MIT License
250 stars 94 forks source link

`pre-translate` command does not work with AI on strings-based project #865

Closed aergonaut closed 2 weeks ago

aergonaut commented 3 weeks ago

Describe the bug The crowdin pre-translate CLI command does not work when used with --method=ai on a strings-based project.

The CLI throws an error that the aiPromptId is missing, even though the --ai-prompt= flag was passed.

To Reproduce Steps to reproduce:

  1. Have a strings-based project
  2. Configure AI pre-translation for the project
  3. Use crowdin pre-translate
  4. Observe error message

Example of the error:

crowdin pre-translate -l el --method=ai --ai-prompt=72007 --branch=main
✔️  Fetching project info    
❌ Pre-translation is running...     
❌ Failed to pre-translate the project. Please contact our support team for help
❌ Wrong parameters: 
<key: method, code: isEmpty, message: Any of [aiPromptId] must be set. Value is required and can't be empty.>

Expected behavior crowdin pre-translate should work for strings-based projects.

I compared this with the API endpoint POST /projects/{projectId}/pre-translations, and the pre-translation job is correctly triggered via API request.

Environment:

Screenshots If applicable, add screenshots to help explain your problem.

Additional context Add any other context about the problem here.