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

feat: quite option for init command #797

Merged
merged 1 commit into from
May 16, 2024
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
28 changes: 2 additions & 26 deletions src/main/java/com/crowdin/cli/BaseCli.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,46 +2,22 @@

import com.crowdin.cli.utils.Utils;

import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.ResourceBundle;

/**
* Created by ihor on 12/1/16.
*/
public class BaseCli {

public static final List<String> DEFAULT_CONFIGS = Collections.unmodifiableList(Arrays.asList("crowdin.yml", "crowdin.yaml"));
public static final List<String> DEFAULT_CONFIGS = List.of("crowdin.yml", "crowdin.yaml");

public static final String DEFAULT_GLOSSARY_NAME = "Created in Crowdin CLI (%s)";
public static final String DEFAULT_TM_NAME = "Created in Crowdin CLI (%s)";

public static final String ALL = "ALL";

public static final List<String> DEFAULT_IDENTITY_FILES = Collections.unmodifiableList(Arrays.asList(
System.getProperty("user.home") + Utils.PATH_SEPARATOR + ".crowdin.yml",
System.getProperty("user.home") + Utils.PATH_SEPARATOR + ".crowdin.yaml"
));

/**
* File format -> Export File Format (see https://support.crowdin.com/api/v2/#operation/api.projects.translations.exports.post)
*/
public static final Map<String, String> FILE_FORMAT_MAPPER = Collections.unmodifiableMap(new HashMap<String, String>() {{
put("xliff", "xliff");
put("xml", "android");
put("strings", "macosx");
put("yml", "yaml-export");
put("resx", "crowdin-resx");
put("csv", "crowdin-csv");
put("properties", "crowdin-properties");
put("arb", "arb-export");
put("stringsdict", "stringsdict-export");
put("po", "po-export");
}}
);
public static final List<String> DEFAULT_IDENTITY_FILES = List.of(System.getProperty("user.home") + Utils.PATH_SEPARATOR + ".crowdin.yml", System.getProperty("user.home") + Utils.PATH_SEPARATOR + ".crowdin.yaml");

public static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle.getBundle("messages/messages");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public class InitSubcommand extends GenericActCommand<NoProperties, NoClient> {
@CommandLine.Option(names = {"--preserve-hierarchy"}, negatable = true, paramLabel = "...", descriptionKey = "params.preserve-hierarchy", order = -2)
private Boolean preserveHierarchy;

@CommandLine.Option(names = "--skip-generate-description", hidden = true)
@CommandLine.Option(names = "--quite", descriptionKey = "params.quite", order = -2)
private boolean skipGenerateDescription;

protected NewAction<NoProperties, NoClient> getAction(Actions actions) {
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 @@ -24,6 +24,7 @@ params.source=Path to the source files
params.translation=Path to the translation files
params.dest=Specify file name in Crowdin
params.preserve-hierarchy=Choose whether to save the directory hierarchy in the Crowdin project
params.quite=Do not ask for interactive input prompts
params.skipUntranslatedStrings=Skip untranslated strings in exported files (does not work with .docx, .html, .md and other document files)
params.skipUntranslatedFiles=Omit downloading not fully translated files
params.keepArchive=Do not remove the downloaded archive with translations after it's extracting
Expand Down
2 changes: 2 additions & 0 deletions website/blog/2024-05-28-cli-v4/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,8 @@ The `generate` alias has been removed:
+crowdin init
```

New `quite` option was added to not ask for interactive input prompts.

### Lint

The `lint` command has been replaced with the [`config lint`](/commands/crowdin-config-lint) command:
Expand Down
Loading