Skip to content

Commit

Permalink
bug: fix translations download without preserve hierarchy
Browse files Browse the repository at this point in the history
  • Loading branch information
katerina20 committed Sep 20, 2023
1 parent 9246038 commit 1598c2c
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,7 @@ private Map<String, String> getFiles(

return this.doTranslationMapping(
forLanguages, fb.getDest(), fb.getTranslation(), serverLanguageMapping, languageMapping,
translationReplace, sources, fb.getSource(), basePath, placeholderUtil);
translationReplace, sources, fb.getSource(), basePath, placeholderUtil, preserveHierarchy);
}

private ProjectBuild buildTranslation(ProjectClient client, BuildProjectTranslationRequest request) {
Expand Down Expand Up @@ -495,7 +495,8 @@ private Map<String, String> doTranslationMapping(
List<String> sources,
String source,
String basePath,
PlaceholderUtil placeholderUtil
PlaceholderUtil placeholderUtil,
boolean preserveHierarchy
) {
Map<String, String> mapping = new HashMap<>();

Expand All @@ -505,6 +506,9 @@ private Map<String, String> doTranslationMapping(

String translationProject1 = placeholderUtil.replaceLanguageDependentPlaceholders(translation, projLanguageMapping, language);
String translationFile1 = placeholderUtil.replaceLanguageDependentPlaceholders(translation, languageMapping, language);
if (!preserveHierarchy) {
translationProject1 = StringUtils.remove(translationProject1, PlaceholderUtil.PLACEHOLDER_ORIGINAL_PATH);
}

for (String projectFile : sources) {
String file = StringUtils.removeStart(projectFile, basePath);
Expand Down

0 comments on commit 1598c2c

Please sign in to comment.