Conversation
🦋 Changeset detectedLatest commit: b0868f9 The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Code Review FindingsAfter reviewing this branch, I've identified a few issues that should be addressed: 1. Default Locale Issue (Critical)File: The default locale is set to locale = 'fr-FR',This should be 2. Missing Runtime FallbackFile: The currency formatter should wrap try {
const formatter = new Intl.NumberFormat(locale, options);
return formatter.format(amount);
} catch (error) {
// Fallback to en-US for invalid locales
const formatter = new Intl.NumberFormat('en-US', options);
return formatter.format(amount);
}3. Parameter Naming ClarityThe Suggested refactor: export function formatCurrency({
amount,
currency,
locale,
inputInMinorUnits = true,
returnRaw = false,
}: {
amount: number;
currency: string;
locale?: string;
inputInMinorUnits?: boolean;
returnRaw?: boolean;
}): string |
Summary
Overview
This PR adds locale support to the GoDaddyProvider and updates the currency formatting system to automatically use the locale from context throughout the application.
Changes
Updated 10 components to use the new useFormatCurrency hook:
Checkout Components
Storefront Components
Usage Example
Changeset
Test Plan