Skip the MessageFormat parse in ForgeI18n for strings with no format syntax (#10894)

This commit is contained in:
BonsUnleashed authored and GitHub committed 2026-10-02 13:18:40 -07:00
1 parent ae3c937073
commit 8418bad66d
1 file changed
+4
@@ -95,6 +95,10 @@ public class ForgeI18n {
}
public static String parseFormat(final String format, final Object... args) {
// No format elements and no quotes: MessageFormat would return the pattern unchanged, so skip parsing it
if (format != null && format.indexOf('{') < 0 && format.indexOf('\'') < 0) {
return format;
}
final ExtendedMessageFormat extendedMessageFormat = new ExtendedMessageFormat(format, customFactories);
return extendedMessageFormat.format(args);
}