Repository navigation
Conversation
I18n.msgImpl created its MessageFormat without a locale, so message arguments such as line and column numbers were formatted with the JVM default locale rather than the locale the message was requested in. On a JVM whose default locale is for example sl_SI, an English message renders -1 with a unicode minus sign and 1234 as "1.234", which also made StringValueParsingUnicodeTest fail on such machines. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Meemaw
marked this pull request as ready for review
October 17, 2026 20:00
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
I18n.msgImplcreates its formatter withnew MessageFormat(msgPattern), which uses the JVM default (format) locale. So the message text comes from the requested locale's bundle, but the arguments (line/column numbers, counts, etc.) are formatted with whatever locale the JVM happens to run in.For example, with a JVM default locale of
sl_SI, an English parser error renders as:instead of
line -1 column -1/column 1,234. A side effect is thatStringValueParsingUnicodeTest(which explicitly requestsLocale.ENGLISH) fails 14 tests on machines with such a default locale.Fix
Pass the I18n instance's locale to the
MessageFormat, so arguments are formatted consistently with the message. This is the onlyMessageFormatusage insrc/main.Note: for a JVM whose default locale already matches the requested locale (the common case) the output is unchanged.
Verification
I18nTestcase that sets the JVM default tosl-SIand checks that an English message formats-1/1,234and a German message formats1.234. Without the fix it fails withline −1 column 1.234.StringValueParsingUnicodeTesttests now pass on asl_SImachine.LANG=sl_SI.UTF-8).🤖 Generated with Claude Code