Fix date/time formatting to use es-ES locale
- Update all date/time formatting functions to use 'es-ES' locale instead of 'en-US' or 'de-DE' - Update utility functions in utils/date.ts and utils/exchange.ts - Update all component files that use date formatting - Update e2e test helper to match new Spanish date format - All formatting now uses Spanish locale regardless of selected language as per PR requirements
This commit is contained in:
parent
d2fc7d8850
commit
e35e79e84d
19 changed files with 146 additions and 50 deletions
|
|
@ -15,18 +15,15 @@ interface LanguageContextType {
|
|||
const LanguageContext = createContext<LanguageContextType | undefined>(undefined);
|
||||
|
||||
export function LanguageProvider({ children }: { children: ReactNode }) {
|
||||
// Start with default locale for SSR consistency
|
||||
const [locale, setLocaleState] = useState<Locale>(DEFAULT_LOCALE);
|
||||
const [isHydrated, setIsHydrated] = useState(false);
|
||||
|
||||
// Load locale from localStorage on mount
|
||||
// Load locale from localStorage after hydration
|
||||
useEffect(() => {
|
||||
const stored = localStorage.getItem(LOCALE_STORAGE_KEY);
|
||||
console.log("[useLanguage] Loading locale from localStorage:", stored);
|
||||
if (stored && (stored === "es" || stored === "en" || stored === "ca")) {
|
||||
console.log("[useLanguage] Setting locale to:", stored);
|
||||
setLocaleState(stored as Locale);
|
||||
} else {
|
||||
console.log("[useLanguage] No valid stored locale, using default:", DEFAULT_LOCALE);
|
||||
}
|
||||
setIsHydrated(true);
|
||||
}, []);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue