From 850a4797aec2bcbeb1cf72206efeaf09b17a25fd Mon Sep 17 00:00:00 2001 From: Yevheniy Oliynyk Date: Sat, 21 Sep 2024 19:36:04 +0200 Subject: [PATCH] feat: pre-translate whole project --- .../crowdin/cli/commands/actions/PreTranslateAction.java | 6 ++---- src/main/resources/messages/messages.properties | 1 - 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/crowdin/cli/commands/actions/PreTranslateAction.java b/src/main/java/com/crowdin/cli/commands/actions/PreTranslateAction.java index e6610d50..18d901e9 100644 --- a/src/main/java/com/crowdin/cli/commands/actions/PreTranslateAction.java +++ b/src/main/java/com/crowdin/cli/commands/actions/PreTranslateAction.java @@ -66,10 +66,6 @@ public void act(Outputter out, PropertiesWithFiles properties, ProjectClient cli return; } - if ((files == null || files.isEmpty()) && StringUtils.isEmpty(directory)) { - throw new ExitCodeExceptionMapper.ValidationException(RESOURCE_BUNDLE.getString("error.file_or_directory_required")); - } - Optional branch = Optional.ofNullable(branchName).flatMap(project::findBranchByName); if (!branch.isPresent() && branchName != null) { @@ -107,6 +103,8 @@ public void act(Outputter out, PropertiesWithFiles properties, ProjectClient cli fileIds.add(entry.getValue().getId()); } } + } else { + fileIds = paths.values().stream().map(FileInfo::getId).toList(); } if (fileIds.isEmpty()) { diff --git a/src/main/resources/messages/messages.properties b/src/main/resources/messages/messages.properties index a1e9717a..0b173511 100755 --- a/src/main/resources/messages/messages.properties +++ b/src/main/resources/messages/messages.properties @@ -497,7 +497,6 @@ error.while_checking_base_path=Failed to check the base path. Try to run the app error.skip_untranslated_both_strings_and_files=You cannot skip strings and files at the same time. Please use one of these parameters instead. error.file_not_exists=Project doesn't contain the '%s' file error.file_required=The '--file' parameter is required for this type of project -error.file_or_directory_required=The '--file' or '--directory' parameter is required for this type of project error.dir_not_exists=Project doesn't contain the '%s' directory error.branch_not_exists=Project doesn't contain the '%s' branch error.source_string_no_edit=Specify some parameters to edit the string