Skip to content

Commit

Permalink
chore: add FAQ link to some common warnings (#627)
Browse files Browse the repository at this point in the history
  • Loading branch information
andrii-bodnar authored Aug 29, 2023
1 parent 46fc50f commit 08898c5
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
import static com.crowdin.cli.BaseCli.CHECK_WAITING_TIME_INCREMENT;
import static com.crowdin.cli.BaseCli.CHECK_WAITING_TIME_MAX;
import static com.crowdin.cli.BaseCli.RESOURCE_BUNDLE;
import static com.crowdin.cli.utils.console.ExecutionStatus.EMPTY;
import static com.crowdin.cli.utils.console.ExecutionStatus.ERROR;
import static com.crowdin.cli.utils.console.ExecutionStatus.OK;
import static com.crowdin.cli.utils.console.ExecutionStatus.WARNING;
Expand Down Expand Up @@ -300,6 +301,7 @@ public void act(Outputter out, PropertiesWithFiles pb, ProjectClient client) {

if (!totalOmittedFiles.isEmpty()) {
out.println(WARNING.withIcon(RESOURCE_BUNDLE.getString("message.downloaded_files_omitted")));

totalOmittedFiles.forEach((file, translations) -> {
out.println(String.format(
RESOURCE_BUNDLE.getString("message.item_list_with_count"), file, translations.size()));
Expand All @@ -308,18 +310,21 @@ public void act(Outputter out, PropertiesWithFiles pb, ProjectClient client) {
String.format(RESOURCE_BUNDLE.getString("message.inner_item_list"), trans)));
}
});

out.println(EMPTY.withIcon(RESOURCE_BUNDLE.getString("message.faq_link")));
}

List<String> totalOmittedFilesNoSources = omittedFilesNoSources.isEmpty() ? new ArrayList<>() : omittedFilesNoSources.get(0);
for (List<String> eachOmittedFilesNoSources : omittedFilesNoSources) {
totalOmittedFilesNoSources.retainAll(eachOmittedFilesNoSources);
}
if (!totalOmittedFilesNoSources.isEmpty()) {
out.println(
WARNING.withIcon(
RESOURCE_BUNDLE.getString("message.downloaded_files_omitted_without_sources")));
out.println(WARNING.withIcon(RESOURCE_BUNDLE.getString("message.downloaded_files_omitted_without_sources")));

totalOmittedFilesNoSources.forEach(file ->
out.println(String.format(RESOURCE_BUNDLE.getString("message.item_list"), file)));

out.println(EMPTY.withIcon(RESOURCE_BUNDLE.getString("message.faq_link")));
}
}
} finally {
Expand Down
2 changes: 2 additions & 0 deletions src/main/resources/messages/messages.properties
Original file line number Diff line number Diff line change
Expand Up @@ -626,6 +626,8 @@ message.spinner.pre_translate_percents=Pre-translation is completed by @|bold (%
message.spinner.pre_translate_done=Pre-translation is finished @|bold (%d%%)|@
message.spinner.build_has_failed=The build has failed

message.faq_link=Visit the @|cyan https://crowdin.github.io/crowdin-cli/faq|@ for more details

message.tree.elem=@|cyan \u251C\u2500\u0020|@
message.tree.last_elem=@|cyan \u2570\u2500\u0020|@
message.tree.dir=@|cyan \u2502\u0020\u0020|@
Expand Down

0 comments on commit 08898c5

Please sign in to comment.