Skip to content

Commit

Permalink
fix: empty asterisks in translation
Browse files Browse the repository at this point in the history
  • Loading branch information
katerina20 committed Mar 26, 2024
1 parent ed8f9b8 commit 10b85bd
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ public static String replaceDoubleAsterisk(String sourcePattern, String translat
} else {
sourceFile = "";
}
} else if (Utils.noSepAtStart(s).length() > 0 && sourceFile.startsWith(Utils.noSepAtStart(s))) {
sourceFile = "";
}
}
} else if (sourceFile.contains(".")) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,16 @@ static Stream<Arguments> testReplaceDoubleAsterisk() {
Utils.normalizePath("/%two_letters_code%/**/%original_file_name%"),
Utils.normalizePath("en/here/file.po"),
Utils.normalizePath("/%two_letters_code%/here/%original_file_name%")),
arguments(
Utils.normalizePath("/en/**/folder/*.po"),
Utils.normalizePath("/%two_letters_code%/**/%original_file_name%"),
Utils.normalizePath("en/folder/file.po"),
Utils.normalizePath("/%two_letters_code%/%original_file_name%")),
arguments(
Utils.normalizePath("/en/**/folder/*.po"),
Utils.normalizePath("/%two_letters_code%/**/folder/%original_file_name%"),
Utils.normalizePath("en/here/folder/file.po"),
Utils.normalizePath("/%two_letters_code%/here/folder/%original_file_name%")),
arguments(
Utils.normalizePath("/*/**/*.po"),
Utils.normalizePath("/%two_letters_code%/**/%original_file_name%"),
Expand Down

0 comments on commit 10b85bd

Please sign in to comment.