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

feat: add file name to translation upload error message #639

Merged
merged 1 commit into from
Sep 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,10 @@
request.setStorageId(storageId);
} catch (Exception e) {
containsErrors.set(true);
throw new RuntimeException(RESOURCE_BUNDLE.getString("error.upload_translation_to_storage"), e);
throw new RuntimeException(String.format(
RESOURCE_BUNDLE.getString("error.upload_translation_to_storage"),
StringUtils.removeStart(translationFile.getAbsolutePath(), pb.getBasePath())

Check warning on line 181 in src/main/java/com/crowdin/cli/commands/actions/UploadTranslationsAction.java

View check run for this annotation

Codecov / codecov/patch

src/main/java/com/crowdin/cli/commands/actions/UploadTranslationsAction.java#L179-L181

Added lines #L179 - L181 were not covered by tests
), e);
}
try {
for (Language lang : langs) {
Expand All @@ -190,7 +193,10 @@
}
} catch (Exception e) {
containsErrors.set(true);
throw new RuntimeException(RESOURCE_BUNDLE.getString("error.upload_translation"), e);
throw new RuntimeException(String.format(
RESOURCE_BUNDLE.getString("error.upload_translation"),
StringUtils.removeStart(translationFile.getAbsolutePath(), pb.getBasePath())

Check warning on line 198 in src/main/java/com/crowdin/cli/commands/actions/UploadTranslationsAction.java

View check run for this annotation

Codecov / codecov/patch

src/main/java/com/crowdin/cli/commands/actions/UploadTranslationsAction.java#L196-L198

Added lines #L196 - L198 were not covered by tests
), e);
}
if (!plainView) {
out.println(OK.withIcon(String.format(
Expand Down
4 changes: 2 additions & 2 deletions src/main/resources/messages/messages.properties
Original file line number Diff line number Diff line change
Expand Up @@ -401,8 +401,8 @@ error.read_resource_file=Couldn't read from the file '%s'. Try to run the applic
error.not_found_branch=The branch with the specified name doesn't exist in the project. Try specifying another branch name
error.source_not_exists_in_project=Failed to upload translations for the source '%s' since file '%s' is missing in the project. Run the 'crowdin push' to upload the missing source
error.translation_not_exists='%s' translation file doesn't exist in the specified place
error.upload_translation_to_storage=Failed to upload the translation file to the storage. Please contact our support team for help
error.upload_translation=Failed to upload the translation file. Please contact our support team for help
error.upload_translation_to_storage=Failed to upload the translation file '%s' to the storage. Please contact our support team for help
error.upload_translation=Failed to upload the translation file '%s'. Please contact our support team for help
error.configuration_file_is_invalid=Configuration file is invalid. Check the following parameters in your configuration file:
error.configuration_is_invalid=Configuration is invalid. Check the following parameters:
error.params_are_invalid=Some command options are invalid. Check the following parameters:
Expand Down