feat(i18n): add localization infrastructure and English catalog

Refs #17
This commit is contained in:
NimBold
2026-07-18 01:06:21 +03:30
parent 62365f514e
commit c914eeb7b3
28 changed files with 1845 additions and 652 deletions
+3 -1
View File
@@ -1,5 +1,6 @@
import React, { createContext, useContext, useState, useCallback, ReactNode, useEffect, useRef, useLayoutEffect } from 'react';
import { CheckCircle2, AlertCircle, Info, XCircle, X } from 'lucide-react';
import { useTranslation } from 'react-i18next';
export type ToastVariant = 'success' | 'info' | 'warning' | 'error';
@@ -69,6 +70,7 @@ export const useToast = () => {
};
const ToastItem: React.FC<{ toast: ToastState; removeToast: (id: string) => void; removeToastCompletely: (id: string) => void }> = ({ toast, removeToast, removeToastCompletely }) => {
const { t } = useTranslation();
const [isMounted, setIsMounted] = useState(false);
const [isHovered, setIsHovered] = useState(false);
const timerStartedAt = useRef<number | null>(null);
@@ -196,7 +198,7 @@ const ToastItem: React.FC<{ toast: ToastState; removeToast: (id: string) => void
<button
onClick={() => removeToast(toast.id)}
className="ml-2 mt-0.5 shrink-0 rounded-md p-1 text-text-secondary opacity-70 transition-all hover:bg-item-hover hover:text-text-primary hover:opacity-100 active:scale-95"
aria-label="Dismiss notification"
aria-label={t($ => $.actions.dismissNotification)}
>
<X className="w-4 h-4" strokeWidth={2.5} />
</button>