Conversation
…get-board into configure-thousands-separator
There was a problem hiding this comment.
Pull request overview
This pull request refactors the date/locale provider to support configurable thousands and decimal separators based on the user's locale. The main changes involve renaming DateProvider to LocaleProvider and adding locale-aware number formatting capabilities.
Changes:
- Renamed
DateProvidertoLocaleProvideranduseDatetouseLocalethroughout the codebase - Added
SignDisplayenum and updatedconvertNumberToCurrencyto accept locale parameter for proper localization - Extracted decimal and thousands separators from user's locale using
Intl.NumberFormat.formatToParts - Updated all NumberInput components to use locale-specific separators and all currency formatting calls to include locale parameter
- Updated translation files to remove hardcoded
%symbol from interest rate messages since it's now part of the formatted percentage
Reviewed changes
Copilot reviewed 66 out of 66 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| client/src/providers/LocaleProvider/LocaleProvider.tsx | Renames DateProvider to LocaleProvider, adds decimalSeparator and thousandsSeparator extraction using Intl.NumberFormat |
| client/src/helpers/currency.ts | Adds SignDisplay enum and updates convertNumberToCurrency signature to include signDisplay and locale parameters |
| client/src/helpers/automaticRules.ts | Updates getFormattedValue to accept and pass intlLocale parameter for currency formatting |
| client/src/components/core/Card/TransactionCard/TransactionCardBase/TransactionCardContent/TransactionCardContent.tsx | Updates to use useLocale and passes intlLocale to convertNumberToCurrency |
| client/src/components/core/Card/TransactionCard/TransactionCardBase/EditableTransactionCardContent/SplitTransaction/SplitTransaction.tsx | Adds locale-specific thousand and decimal separators to NumberInput |
| client/src/components/core/Card/TransactionCard/TransactionCardBase/EditableTransactionCardContent/EditableTransactionCardContent.tsx | Adds locale-specific separators to NumberInput and uses dayjsLocale for DateInput |
| Multiple chart components | Updates all chart components to use useLocale and pass intlLocale to convertNumberToCurrency for tooltips |
| Multiple budget, goal, account, asset, and transaction components | Consistently updates all NumberInput components with separators and all convertNumberToCurrency calls with SignDisplay and locale |
| client/public/locales/en-us/translation.json | Removes hardcoded % from interest_rate_message translation |
| client/public/locales/de/translation.json | Removes hardcoded % from interest_rate_message translation |
| client/src/App.tsx | Updates import and component usage from DateProvider to LocaleProvider |
Comments suppressed due to low confidence (1)
client/src/providers/LocaleProvider/LocaleProvider.tsx:88
- The
Intl.NumberFormatconstructor is being passeddayjsLocale(e.g., "en", "de", "fr", "zh-cn"), but it should receive the full locale identifier like "en-US", "de-DE", etc. ThedayjsLocaleis a simplified locale code used by dayjs, not a valid BCP 47 language tag expected byIntl.NumberFormat.
This could cause the NumberFormat to fall back to default behavior or not respect the user's language setting properly. Instead, use i18n.language which contains the correct locale identifier (e.g., "en-us", "de", "fr").
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
No description provided.