Skip to content

Conversation

@bonqus
Copy link

@bonqus bonqus commented Jan 27, 2026

Summary

  • add the same exclude-language option of crowdin pull to crowdin pre-translate.
  • add unit test covering exclude-language filtering

This is useful for the same reasons that it was added to the pull command.
If 20 languages, except one, need pre-translating. I need to specify 19 languages; instead of excluding one.
This also ensures more consistency in the crowdin cli options.

Testing

  • ./gradlew test --tests "com.crowdin.cli.commands.actions.PreTranslateActionTest.testPreTranslate_ExcludeLanguages"

@codecov
Copy link

codecov bot commented Jan 27, 2026

Codecov Report

❌ Patch coverage is 58.33333% with 10 lines in your changes missing coverage. Please review.
✅ Project coverage is 65.30%. Comparing base (8fab555) to head (b424ad1).

Files with missing lines Patch % Lines
...owdin/cli/commands/actions/PreTranslateAction.java 65.00% 2 Missing and 5 partials ⚠️
...n/cli/commands/picocli/PreTranslateSubcommand.java 0.00% 2 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main     #982      +/-   ##
============================================
+ Coverage     65.30%   65.30%   +0.01%     
- Complexity     1671     1679       +8     
============================================
  Files           244      244              
  Lines          6860     6881      +21     
  Branches       1043     1046       +3     
============================================
+ Hits           4479     4493      +14     
- Misses         1787     1790       +3     
- Partials        594      598       +4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds support for --exclude-language to crowdin pre-translate, matching the behavior available in other commands and improving ergonomics when most languages should be targeted except a few.

Changes:

  • Add --exclude-language/-e option to pre-translate and validate it can’t be used with an explicit --language list (except all).
  • Thread the new option through PreTranslateSubcommand -> Actions/CliActions -> PreTranslateAction and apply filtering in language selection.
  • Add/adjust unit tests to cover exclude-language filtering and updated method signatures.

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/main/java/com/crowdin/cli/commands/picocli/PreTranslateSubcommand.java Adds the new CLI option and conflict validation, passes it into the action factory.
src/main/java/com/crowdin/cli/commands/actions/PreTranslateAction.java Validates excluded language IDs and filters them out when “all languages” mode is used.
src/main/java/com/crowdin/cli/commands/Actions.java Updates the preTranslate API to include excludeLanguageIds.
src/main/java/com/crowdin/cli/commands/actions/CliActions.java Wires the new parameter into PreTranslateAction construction.
src/main/resources/messages/messages.properties Adds help text and a dedicated conflict error key for pre-translate.
src/test/java/com/crowdin/cli/commands/actions/PreTranslateActionTest.java Adds coverage for exclude-language filtering and updates existing tests for the new constructor signature.
src/test/java/com/crowdin/cli/commands/actions/CliActionsTest.java Updates test call to match the new preTranslate signature.
src/test/java/com/crowdin/cli/commands/picocli/PicocliTestUtils.java Updates mocks/stubs for the new preTranslate signature.
src/test/java/com/crowdin/cli/commands/picocli/PreTranslateSubcommandTest.java Updates verification for the new preTranslate signature.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@andrii-bodnar
Copy link
Member

Hi @bonqus, thanks a lot for the contribution! It's a nice addition to the pre-translate command.

Please refer to Copilot's comment above. If you don't think it's relevant, just resolve it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants