Skip to content

Commit

Permalink
fix: empty asterisks in translation (#750)
Browse files Browse the repository at this point in the history
  • Loading branch information
katerina20 authored Mar 26, 2024
1 parent 3ce64dc commit 6516846
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 6516846

Please sign in to comment.