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

chore: add FAQ link to some common warnings #627

Merged
merged 1 commit into from
Aug 29, 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 @@ -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