Skip to content

Commit

Permalink
feat: deprecate skip-untranslated-strings for task add command (#860)
Browse files Browse the repository at this point in the history
  • Loading branch information
katerina20 authored Oct 24, 2024
1 parent 102c73a commit bb43466
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@

import java.util.*;

import static com.crowdin.cli.utils.console.ExecutionStatus.WARNING;
import static java.lang.System.out;

@CommandLine.Command(
name = CommandNames.ADD,
sortOptions = false
Expand Down Expand Up @@ -46,7 +49,7 @@ class TaskAddSubcommand extends ActCommandTask {
@CommandLine.Option(names = {"--skip-assigned-strings"}, paramLabel = "...", negatable = true, descriptionKey = "crowdin.task.add.skip-assigned-strings", order = -2)
protected boolean skipAssignedStrings;

@CommandLine.Option(names = {"--skip-untranslated-strings"}, paramLabel = "...", negatable = true, descriptionKey = "crowdin.task.add.skip-untranslated-strings", order = -2)
@CommandLine.Option(names = {"--skip-untranslated-strings"}, hidden = true, paramLabel = "...", negatable = true, descriptionKey = "crowdin.task.add.skip-untranslated-strings", order = -2)
protected boolean skipUntranslatedStrings;

@CommandLine.Option(names = {"--include-pre-translated-strings-only"}, paramLabel = "...", negatable = true, descriptionKey = "crowdin.task.add.include-pre-translated-strings-only", order = -2)
Expand Down Expand Up @@ -84,7 +87,10 @@ protected NewAction<ProjectProperties, ClientTask> getAction(Actions actions) {

@Override
protected List<String> checkOptions() {
String url = this.getProperties(propertiesBuilders, new PicocliOutputter(System.out, isAnsi())).getBaseUrl();
if (skipUntranslatedStrings) {
out.println(WARNING.withIcon(RESOURCE_BUNDLE.getString("message.skip-untranslated-strings_deprecated")));
}
String url = this.getProperties(propertiesBuilders, new PicocliOutputter(out, isAnsi())).getBaseUrl();
boolean isEnterprise = PropertiesBeanUtils.isOrganization(url);
return checkOptions(isEnterprise);
}
Expand Down
1 change: 1 addition & 0 deletions src/main/resources/messages/messages.properties
Original file line number Diff line number Diff line change
Expand Up @@ -692,6 +692,7 @@ message.already_uploaded=Skipping file '%s' because it is already uploading/uplo
message.extracted_organization_name=Extracted organization name from provided url: %s
message.file_deleted=@|green File '%s' deleted|@
message.no_file_string_project=File management is not available for string-based projects
message.skip-untranslated-strings_deprecated=The '--skip-untranslated-strings' option is deprecated and will be removed in the future

message.download_sources.preserve_hierarchy_warning=Because the 'preserve_hierarchy' parameter is set to 'false':\n\t- CLI might download some unexpected files that match the pattern;\n\t- Source file hierarchy may not be preserved and will be the same as in Crowdin.
message.download_translations.preserve_hierarchy_warning=Because the 'preserve_hierarchy' parameter is set to 'false' CLI might download some unexpected files that match the pattern
Expand Down

0 comments on commit bb43466

Please sign in to comment.