From 4c84f249771edb726879a73f893738ae123dddf0 Mon Sep 17 00:00:00 2001 From: Andrii Bodnar Date: Wed, 25 May 2022 09:26:09 +0300 Subject: [PATCH] Support language ID in list languages command --- src/main/java/com/crowdin/cli/BaseCli.java | 2 +- .../com/crowdin/cli/commands/actions/ListLanguagesAction.java | 2 ++ src/main/resources/messages/messages.properties | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/crowdin/cli/BaseCli.java b/src/main/java/com/crowdin/cli/BaseCli.java index da5878189..9d231165f 100644 --- a/src/main/java/com/crowdin/cli/BaseCli.java +++ b/src/main/java/com/crowdin/cli/BaseCli.java @@ -55,7 +55,7 @@ public class BaseCli { public static final String IGNORE_HIDDEN_FILES_PATTERN = "**/.*"; public enum LanguageCode { - two_letters_code, three_letters_code, locale, android_code, osx_code, osx_locale + id, two_letters_code, three_letters_code, locale, android_code, osx_code, osx_locale } public static final Integer CHECK_WAITING_TIME_FIRST = 1000; diff --git a/src/main/java/com/crowdin/cli/commands/actions/ListLanguagesAction.java b/src/main/java/com/crowdin/cli/commands/actions/ListLanguagesAction.java index a4c7bc2a8..dca259f10 100644 --- a/src/main/java/com/crowdin/cli/commands/actions/ListLanguagesAction.java +++ b/src/main/java/com/crowdin/cli/commands/actions/ListLanguagesAction.java @@ -64,6 +64,8 @@ private String getCode(LanguageMapping langMapping, Language language) { return language.getTwoLettersCode(); } switch (code) { + case id: + return language.getId(); case three_letters_code: return langMapping.getValueOrDefault(language.getId(), PLACEHOLDER_THREE_LETTERS_CODE.replaceAll("%", ""), language.getThreeLettersCode()); diff --git a/src/main/resources/messages/messages.properties b/src/main/resources/messages/messages.properties index 8a569856a..2d282c5a0 100755 --- a/src/main/resources/messages/messages.properties +++ b/src/main/resources/messages/messages.properties @@ -87,7 +87,7 @@ crowdin.list.branches.usage.customSynopsis=@|fg(green) crowdin list branches|@ [ #CROWDIN LIST LANGUAGES COMMAND crowdin.list.languages.usage.description=List target languages in the current project crowdin.list.languages.usage.customSynopsis=@|fg(green) crowdin list languages|@ [CONFIG OPTIONS] [OPTIONS] -crowdin.list.languages.code=Specify language code. Available values: two_letters_code, three_letters_code, locale, android_code, osx_code, osx_locale. Default: two_letters_code +crowdin.list.languages.code=Specify language code. Available values: id, two_letters_code, three_letters_code, locale, android_code, osx_code, osx_locale. Default: two_letters_code # CROWDIN COMMAND crowdin.usage.description.0=Crowdin CLI is a command-line tool that allows you to manage and synchronize localization resources with your Crowdin project.