Skip to content

Commit

Permalink
feat: add file name to translation upload error message (#639)
Browse files Browse the repository at this point in the history
  • Loading branch information
katerina20 authored Sep 12, 2023
1 parent b258eef commit 9246038
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,10 @@ public void act(Outputter out, PropertiesWithFiles pb, ProjectClient client) {
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())
), e);
}
try {
for (Language lang : langs) {
Expand All @@ -190,7 +193,10 @@ public void act(Outputter out, PropertiesWithFiles pb, ProjectClient client) {
}
} 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())
), 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

0 comments on commit 9246038

Please sign in to comment.