Skip to content

Commit

Permalink
Support language ID in list languages command
Browse files Browse the repository at this point in the history
  • Loading branch information
andrii-bodnar committed May 25, 2022
1 parent 7625190 commit 4c84f24
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/main/java/com/crowdin/cli/BaseCli.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/messages/messages.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 4c84f24

Please sign in to comment.