diff --git a/src/components/layout/Sidebar.tsx b/src/components/layout/Sidebar.tsx index 03830ea..d3e219f 100644 --- a/src/components/layout/Sidebar.tsx +++ b/src/components/layout/Sidebar.tsx @@ -11,6 +11,7 @@ import { AppError } from "@/utils/errors"; import { ERROR_CODES } from "@/constants/errorCodes"; import { ERROR_MESSAGES } from "@/constants/errorMessages"; import { useToast } from "@/components/ui/use-toast"; +import { useTranslate } from "@/hooks/useTranslate"; interface SidebarProps { isOpen: boolean; @@ -18,6 +19,7 @@ interface SidebarProps { } export function Sidebar({ isOpen, onClose }: SidebarProps) { + const { t } = useTranslate(); const pathname = usePathname(); const router = useRouter(); const { preferences } = usePreferences(); @@ -161,12 +163,12 @@ export function Sidebar({ isOpen, onClose }: SidebarProps) { const mainNavItems = [ { - title: "Accueil", + title: t("sidebar.home"), href: "/", icon: Home, }, { - title: "Téléchargements", + title: t("sidebar.downloads"), href: "/downloads", icon: Download, }, @@ -186,7 +188,9 @@ export function Sidebar({ isOpen, onClose }: SidebarProps) {
-

Navigation

+

+ {t("sidebar.navigation")} +

{mainNavItems.map((item) => (
{isLoading ? ( -
Chargement...
+
+ {t("sidebar.libraries.loading")} +
) : libraries.length === 0 ? ( -
Aucune bibliothèque
+
+ {t("sidebar.libraries.empty")} +
) : ( libraries.map((library) => (
@@ -289,7 +307,7 @@ export function Sidebar({ isOpen, onClose }: SidebarProps) { className="flex w-full items-center rounded-lg px-3 py-2 text-sm font-medium text-destructive hover:bg-destructive/10 hover:text-destructive" > - Se déconnecter + {t("sidebar.logout")} diff --git a/src/components/settings/ClientSettings.tsx b/src/components/settings/ClientSettings.tsx index 28ba2fc..046b8f1 100644 --- a/src/components/settings/ClientSettings.tsx +++ b/src/components/settings/ClientSettings.tsx @@ -10,6 +10,7 @@ import { Switch } from "@/components/ui/switch"; import { Label } from "@/components/ui/label"; import { CacheModeSwitch } from "@/components/settings/CacheModeSwitch"; import { KomgaConfig, TTLConfigData } from "@/types/komga"; +import { useTranslate } from "@/hooks/useTranslate"; interface ClientSettingsProps { initialConfig: KomgaConfig | null; @@ -17,6 +18,7 @@ interface ClientSettingsProps { } export function ClientSettings({ initialConfig, initialTTLConfig }: ClientSettingsProps) { + const { t } = useTranslate(); const router = useRouter(); const { toast } = useToast(); const [isLoading, setIsLoading] = useState(false); @@ -64,8 +66,8 @@ export function ClientSettings({ initialConfig, initialTTLConfig }: ClientSettin } toast({ - title: "Cache supprimé", - description: "Cache serveur supprimé avec succès", + title: t("settings.cache.title"), + description: t("settings.cache.messages.cleared"), }); router.refresh(); } catch (error) { @@ -110,8 +112,8 @@ export function ClientSettings({ initialConfig, initialTTLConfig }: ClientSettin } toast({ - title: "Connexion réussie", - description: "La connexion au serveur Komga a été établie avec succès", + title: t("settings.komga.title"), + description: t("settings.komga.messages.connectionSuccess"), }); } catch (error) { console.error("Erreur:", error); @@ -173,8 +175,8 @@ export function ClientSettings({ initialConfig, initialTTLConfig }: ClientSettin setIsEditingConfig(false); toast({ - title: "Configuration sauvegardée", - description: "La configuration a été sauvegardée avec succès", + title: t("settings.komga.title"), + description: t("settings.komga.messages.configSaved"), }); // Forcer un rechargement complet de la page @@ -227,8 +229,8 @@ export function ClientSettings({ initialConfig, initialTTLConfig }: ClientSettin } toast({ - title: "Configuration TTL sauvegardée", - description: "La configuration des TTL a été sauvegardée avec succès", + title: t("settings.cache.title"), + description: t("settings.cache.messages.ttlSaved"), }); } catch (error) { console.error("Erreur lors de la sauvegarde:", error); @@ -245,8 +247,8 @@ export function ClientSettings({ initialConfig, initialTTLConfig }: ClientSettin try { await updatePreferences({ showThumbnails: checked }); toast({ - title: "Préférences sauvegardées", - description: "Les préférences ont été mises à jour avec succès", + title: t("settings.title"), + description: t("settings.komga.messages.configSaved"), }); } catch (error) { toast({ @@ -263,7 +265,7 @@ export function ClientSettings({ initialConfig, initialTTLConfig }: ClientSettin return (
-

Préférences

+

{t("settings.title")}

{/* Messages de succès/erreur */} @@ -284,19 +286,19 @@ export function ClientSettings({ initialConfig, initialTTLConfig }: ClientSettin

- Préférences d'affichage + {t("settings.display.title")}

- Personnalisez l'affichage de votre bibliothèque. + {t("settings.display.description")}

- +

- Utiliser les vignettes au lieu des premières pages pour l'affichage des séries + {t("settings.display.thumbnails.description")}

- +

- Afficher uniquement les séries non lues par défaut + {t("settings.display.unreadFilter.description")}

- +

- Afficher les informations de debug dans l'interface + {t("settings.display.debugMode.description")}

- Configuration Komga + {t("settings.komga.title")}

- Configurez les informations de connexion à votre serveur Komga. + {t("settings.komga.description")}

@@ -392,15 +390,15 @@ export function ClientSettings({ initialConfig, initialTTLConfig }: ClientSettin
- +

{config.serverUrl}

- +

{config.username}

- +

••••••••

@@ -409,7 +407,7 @@ export function ClientSettings({ initialConfig, initialTTLConfig }: ClientSettin onClick={() => setIsEditingConfig(true)} className="inline-flex items-center justify-center rounded-md bg-secondary px-3 py-2 text-sm font-medium text-secondary-foreground ring-offset-background transition-colors hover:bg-secondary/80 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2" > - Modifier la configuration + {t("settings.komga.buttons.edit")}
) : ( @@ -417,7 +415,7 @@ export function ClientSettings({ initialConfig, initialTTLConfig }: ClientSettin
- Sauvegarde... + {t("settings.komga.buttons.saving")} ) : ( - "Sauvegarder" + t("settings.komga.buttons.save") )} {initialConfig && ( @@ -502,7 +500,7 @@ export function ClientSettings({ initialConfig, initialTTLConfig }: ClientSettin }} className="flex-1 inline-flex items-center justify-center rounded-md bg-secondary px-3 py-2 text-sm font-medium text-secondary-foreground ring-offset-background transition-colors hover:bg-secondary/80 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2" > - Annuler + {t("settings.komga.buttons.cancel")} )}
@@ -517,18 +515,18 @@ export function ClientSettings({ initialConfig, initialTTLConfig }: ClientSettin

- Configuration du Cache + {t("settings.cache.title")}

- Gérez les paramètres de mise en cache des données. + {t("settings.cache.description")}

- +

- Le cache en mémoire est plus rapide mais ne persiste pas entre les redémarrages + {t("settings.cache.mode.description")}

@@ -539,7 +537,7 @@ export function ClientSettings({ initialConfig, initialTTLConfig }: ClientSettin
- Sauvegarder les TTL + {t("settings.cache.buttons.saveTTL")}
diff --git a/src/i18n/messages/en/common.json b/src/i18n/messages/en/common.json index a966e50..b1105e0 100644 --- a/src/i18n/messages/en/common.json +++ b/src/i18n/messages/en/common.json @@ -27,5 +27,89 @@ "latest_series": "Latest series", "recently_added": "Recently added" } + }, + "sidebar": { + "navigation": "Navigation", + "home": "Home", + "downloads": "Downloads", + "favorites": { + "title": "Favorites", + "empty": "No favorites", + "loading": "Loading..." + }, + "libraries": { + "title": "Libraries", + "empty": "No libraries", + "loading": "Loading...", + "refresh": "Refresh libraries" + }, + "settings": { + "title": "Settings", + "preferences": "Preferences" + }, + "logout": "Sign out" + }, + "settings": { + "title": "Preferences", + "display": { + "title": "Display Preferences", + "description": "Customize your library display.", + "thumbnails": { + "label": "Show thumbnails", + "description": "Use thumbnails instead of first pages for series display" + }, + "unreadFilter": { + "label": "Default Unread Filter", + "description": "Show only unread series by default" + }, + "debugMode": { + "label": "Debug mode", + "description": "Show debug information in the interface" + } + }, + "komga": { + "title": "Komga Configuration", + "description": "Configure your Komga server connection information.", + "serverUrl": "Server URL", + "email": "Login email address", + "password": "Password", + "buttons": { + "edit": "Edit configuration", + "save": "Save", + "test": "Test connection", + "cancel": "Cancel", + "saving": "Saving...", + "testing": "Testing..." + }, + "messages": { + "connectionSuccess": "Successfully connected to Komga server", + "configSaved": "Configuration saved successfully" + } + }, + "cache": { + "title": "Cache Configuration", + "description": "Manage data caching settings.", + "mode": { + "label": "Cache mode", + "description": "Memory cache is faster but doesn't persist between restarts" + }, + "ttl": { + "default": "Default TTL (minutes)", + "home": "Home page TTL", + "libraries": "Libraries TTL", + "series": "Series TTL", + "books": "Books TTL", + "images": "Images TTL" + }, + "buttons": { + "saveTTL": "Save TTL", + "clear": "Clear cache", + "clearing": "Clearing..." + }, + "messages": { + "ttlSaved": "TTL configuration saved successfully", + "cleared": "Server cache cleared successfully" + } + } } } diff --git a/src/i18n/messages/fr/common.json b/src/i18n/messages/fr/common.json index d1261e1..96af925 100644 --- a/src/i18n/messages/fr/common.json +++ b/src/i18n/messages/fr/common.json @@ -27,5 +27,89 @@ "latest_series": "Dernières séries", "recently_added": "Ajouts récents" } + }, + "sidebar": { + "navigation": "Navigation", + "home": "Accueil", + "downloads": "Téléchargements", + "favorites": { + "title": "Favoris", + "empty": "Aucun favori", + "loading": "Chargement..." + }, + "libraries": { + "title": "Bibliothèques", + "empty": "Aucune bibliothèque", + "loading": "Chargement...", + "refresh": "Rafraîchir les bibliothèques" + }, + "settings": { + "title": "Configuration", + "preferences": "Préférences" + }, + "logout": "Se déconnecter" + }, + "settings": { + "title": "Préférences", + "display": { + "title": "Préférences d'affichage", + "description": "Personnalisez l'affichage de votre bibliothèque.", + "thumbnails": { + "label": "Afficher les vignettes", + "description": "Utiliser les vignettes au lieu des premières pages pour l'affichage des séries" + }, + "unreadFilter": { + "label": "Filtre \"À lire\" par défaut", + "description": "Afficher uniquement les séries non lues par défaut" + }, + "debugMode": { + "label": "Mode debug", + "description": "Afficher les informations de debug dans l'interface" + } + }, + "komga": { + "title": "Configuration Komga", + "description": "Configurez les informations de connexion à votre serveur Komga.", + "serverUrl": "L'URL du serveur", + "email": "L'adresse email de connexion", + "password": "Mot de passe", + "buttons": { + "edit": "Modifier la configuration", + "save": "Sauvegarder", + "test": "Tester la connexion", + "cancel": "Annuler", + "saving": "Sauvegarde...", + "testing": "Test en cours..." + }, + "messages": { + "connectionSuccess": "La connexion au serveur Komga a été établie avec succès", + "configSaved": "La configuration a été sauvegardée avec succès" + } + }, + "cache": { + "title": "Configuration du Cache", + "description": "Gérez les paramètres de mise en cache des données.", + "mode": { + "label": "Mode de cache", + "description": "Le cache en mémoire est plus rapide mais ne persiste pas entre les redémarrages" + }, + "ttl": { + "default": "TTL par défaut (minutes)", + "home": "TTL page d'accueil", + "libraries": "TTL bibliothèques", + "series": "TTL séries", + "books": "TTL tomes", + "images": "TTL images" + }, + "buttons": { + "saveTTL": "Sauvegarder les TTL", + "clear": "Vider le cache", + "clearing": "Suppression..." + }, + "messages": { + "ttlSaved": "La configuration des TTL a été sauvegardée avec succès", + "cleared": "Cache serveur supprimé avec succès" + } + } } }