Fix/dispenser failures in locale #565
Merged
+122
−9
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.
Fixes #564
This PR fixes a critical bug preventing users with Spanish, Portuguese (Portugal), or Italian browser locales from accessing the testnet dispenser due to a number formatting separator collision error.
The issue stemmed from using 1000 to detect thousand separators, but these locales only apply thousand grouping for numbers ≥10,000. This caused the thousand separator detection to fall back to comma, which conflicted with the comma decimal separator, triggering the error "Decimal separator can't be same as thousand separator". The fix updates the detection to use 10000 instead, ensuring proper grouping appears in all locales. Additional defensive validation was added to the NumericFormat component as a safety net against future locale detection edge cases.
Comprehensive test coverage for Spanish locale was added to both unit and integration tests to prevent regression. A maintenance commit also updates the .nsprc file to reflect changes in npm audit vulnerability IDs.
Before fix when navigating to

http://localhost:5173/testnet/fundAfter fix
