Skip to content

Commit

Permalink
fix type
Browse files Browse the repository at this point in the history
  • Loading branch information
yevheniyJ committed Jan 15, 2025
1 parent 75dba78 commit a58e3dd
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 6 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ It's also possible to disable escaping special characters (`=`, `:`, `!` and `#`
files:
- source: "**/values/strings.xml"
translation: "/values-%two_letters_code%/%original_file_name%"
escape_special_characters: false
escape_special_characters: 0
```

##### Translations upload options
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ private static List<FileBean> getSourcesWithTranslations(Map<String, Object> pro
String translation = getStringProperty(file, PROPERTY_FILES_TRANSLATION);
Boolean updateStrings = getBooleanProperty(file, PROPERTY_FILES_UPDATE_STRINGS);
Boolean cleanupMode = getBooleanProperty(file, PROPERTY_FILES_CLEANUP_MODE);
Boolean escapeSpecialCharacters = getBooleanProperty(file, PROPERTY_ESCAPE_SPECIAL_CHARACTERS);
Integer escapeSpecialCharacters = getIntegerProperty(file, PROPERTY_ESCAPE_SPECIAL_CHARACTERS);
List<String> labels = getListStringsProperty(file, PROPERTY_LABELS);
List<String> excludedTargetLanguages = getListStringsProperty(file, PROPERTY_EXCLUDED_TARGET_LANGUAGES);

Expand Down Expand Up @@ -212,6 +212,10 @@ private static String getStringProperty(Map<String, Object> map, String property
return getProperty(map, property, String.class);
}

private static Integer getIntegerProperty(Map<String, Object> map, String property) {
return getProperty(map, property, Integer.class);
}

private static List<String> getListStringsProperty(Map<String, Object> map, String property) {
List list = getProperty(map, property, List.class);
if (list == null) {
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/com/crowdin/client/config/FileBean.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public class FileBean {
private List<String> labels;
private Boolean cleanupMode;
private Boolean updateStrings;
private Boolean escapeSpecialCharacters;
private Integer escapeSpecialCharacters;

public String getSource() {
return source;
Expand Down Expand Up @@ -61,11 +61,11 @@ public void setUpdateStrings(Boolean updateStrings) {
this.updateStrings = updateStrings;
}

public Boolean getEscapeSpecialCharacters() {
public Integer getEscapeSpecialCharacters() {
return escapeSpecialCharacters;
}

public void setEscapeSpecialCharacters(Boolean escapeSpecialCharacters) {
public void setEscapeSpecialCharacters(Integer escapeSpecialCharacters) {
this.escapeSpecialCharacters = escapeSpecialCharacters;
}

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/crowdin/logic/SourceLogic.java
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ public void uploadSource(VirtualFile source, FileBean fileBean, boolean preserve
}

if (fileBean.getEscapeSpecialCharacters() != null) {
exportOptions.setEscapeSpecialCharacters(fileBean.getEscapeSpecialCharacters() ? 1 : 0);
exportOptions.setEscapeSpecialCharacters(fileBean.getEscapeSpecialCharacters());
}

String outputName = FileUtil.noSepAtStart(path);
Expand Down

0 comments on commit a58e3dd

Please sign in to comment.