Conversation
… under non-en-US locales
Related: open #71750 already changes these same three formatter paths and includes focused regression coverage. This PR is a narrower subset; maintainers can choose the preferred review unit. |
7 tasks
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.
Summary
Three desktop call sites format numbers/currency through the implicit system locale (bare
.toLocaleString()/new Intl.NumberFormat(undefined, ...)), so the vitest suite fails on any machine running a non-en-USsystem locale (e.g.pl_PL.UTF-8groups thousands with U+00A0 and renders USD as10 USDwith a non-breaking space, which also defeats@testing-library's whitespace-normalizedgetByText).fallback-model/format.ts—omitted.toLocaleString()->omitted.toLocaleString('en-US')use-prompt-actions/utils.ts— pin'en-US'on the four.toLocaleString()calls in the usage linebilling-amounts.ts—new Intl.NumberFormat(undefined, ...)->new Intl.NumberFormat('en-US', ...)This matches the existing pinned-locale pattern already used in
use-billing-state.ts(credits.toLocaleString('en-US'),new Intl.NumberFormat('en-US', ...)), so it is consistency rather than a new convention.Fixes #98849
Testing
Worktree from
main(4f22543),apps/desktop, Node v26.7.0:RED check on unpatched
mainunder the same env — exactly the four tests named in the issue fail:Also green under
en_US.UTF-8, plustsc -p . --noEmitandeslintclean on the three touched files.