Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1008 +/- ##
============================================
- Coverage 65.26% 65.11% -0.14%
- Complexity 1679 1773 +94
============================================
Files 244 255 +11
Lines 6887 7339 +452
Branches 1047 1110 +63
============================================
+ Hits 4494 4778 +284
- Misses 1795 1917 +122
- Partials 598 644 +46 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
| if (e instanceof ResponseException) { | ||
| ConsoleSpinner.stop(WARNING); | ||
| throw (ResponseException) e; | ||
| } |
There was a problem hiding this comment.
Is there a risk of getting another ResponseException and treating it as a warning? We have a bunch of response exceptions that should be treated as errors
There was a problem hiding this comment.
Pull request overview
This PR adjusts translation upload behavior so that when a translation file can’t be imported because its target language isn’t enabled for the source file in Crowdin, the CLI prints a warning instead of failing with an error.
Changes:
- Added a new user-facing warning message for “translation not uploaded because target language isn’t enabled”.
- Updated
Client.executeAsyncActionWithoutSpinnerto propagateResponseException(so callers can handleWrongLanguageExceptionexplicitly). - Handled
WrongLanguageExceptioninUploadTranslationsActionto print a warning and skip the failing import.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
src/main/resources/messages/messages.properties |
Adds a new localized warning message used when import is blocked by disabled target languages. |
src/main/java/com/crowdin/cli/commands/actions/UploadTranslationsAction.java |
Catches WrongLanguageException during translation import and prints a warning instead of failing. |
src/main/java/com/crowdin/cli/client/Client.java |
Updates async execution helper to rethrow ResponseException and stop the spinner with WARNING status for those cases. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
|
|
||
| message.warning.not_yml=File '%s' is not a YAML or YML file | ||
| message.warning.browser_not_found=\nError opening a web browser. Please open the following link manually:\n%s | ||
| message.warning.file_not_uploaded_cause_of_language=Translation file @|yellow '%s' hasn't been uploaded|@ since %s is not enabled as a target language for the source file in your Crowdin project |
| } | ||
|
|
||
| static <S> S executeAsyncActionWithoutSpinner( | ||
| static <S> S executeAsyncActionWithoutSpinner ( |
| } catch (WrongLanguageException e) { | ||
| String languageNames = langs.stream() | ||
| .map(Language::getName) | ||
| .collect(Collectors.joining("/")); | ||
| out.println(WARNING.withIcon(String.format( |
No description provided.