Skip to content

Commit

Permalink
Fix ComponentLocalizer '%' escape and error message
Browse files Browse the repository at this point in the history
  • Loading branch information
NichtStudioCode committed Jan 12, 2024
1 parent 02de62f commit e4d24de
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,14 @@ protected List<C> decomposeFormatString(String lang, String formatString, C comp
var end = matcher.end();

// check for escaped %
var matchedStr = formatString.substring(i, start);
var matchedStr = formatString.substring(start, end);
if ("%%".equals(matchedStr)) {
sb.append('%');
} else {
// check for invalid format, only %s is supported
var argType = matcher.group(2);
if (!"s".equals(argType)) {
throw new IllegalStateException("Unsupported format: '" + matchedStr + "'");
throw new IllegalStateException("Unsupported placeholder format: '" + matchedStr + "'");
}

// retrieve argument index
Expand Down

0 comments on commit e4d24de

Please sign in to comment.