feat: i18n : sidebar and settings page
This commit is contained in:
@@ -11,6 +11,7 @@ import { AppError } from "@/utils/errors";
|
|||||||
import { ERROR_CODES } from "@/constants/errorCodes";
|
import { ERROR_CODES } from "@/constants/errorCodes";
|
||||||
import { ERROR_MESSAGES } from "@/constants/errorMessages";
|
import { ERROR_MESSAGES } from "@/constants/errorMessages";
|
||||||
import { useToast } from "@/components/ui/use-toast";
|
import { useToast } from "@/components/ui/use-toast";
|
||||||
|
import { useTranslate } from "@/hooks/useTranslate";
|
||||||
|
|
||||||
interface SidebarProps {
|
interface SidebarProps {
|
||||||
isOpen: boolean;
|
isOpen: boolean;
|
||||||
@@ -18,6 +19,7 @@ interface SidebarProps {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function Sidebar({ isOpen, onClose }: SidebarProps) {
|
export function Sidebar({ isOpen, onClose }: SidebarProps) {
|
||||||
|
const { t } = useTranslate();
|
||||||
const pathname = usePathname();
|
const pathname = usePathname();
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const { preferences } = usePreferences();
|
const { preferences } = usePreferences();
|
||||||
@@ -161,12 +163,12 @@ export function Sidebar({ isOpen, onClose }: SidebarProps) {
|
|||||||
|
|
||||||
const mainNavItems = [
|
const mainNavItems = [
|
||||||
{
|
{
|
||||||
title: "Accueil",
|
title: t("sidebar.home"),
|
||||||
href: "/",
|
href: "/",
|
||||||
icon: Home,
|
icon: Home,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: "Téléchargements",
|
title: t("sidebar.downloads"),
|
||||||
href: "/downloads",
|
href: "/downloads",
|
||||||
icon: Download,
|
icon: Download,
|
||||||
},
|
},
|
||||||
@@ -186,7 +188,9 @@ export function Sidebar({ isOpen, onClose }: SidebarProps) {
|
|||||||
<div className="flex-1 space-y-4 py-4 overflow-y-auto">
|
<div className="flex-1 space-y-4 py-4 overflow-y-auto">
|
||||||
<div className="px-3 py-2">
|
<div className="px-3 py-2">
|
||||||
<div className="space-y-1">
|
<div className="space-y-1">
|
||||||
<h2 className="mb-2 px-4 text-lg font-semibold tracking-tight">Navigation</h2>
|
<h2 className="mb-2 px-4 text-lg font-semibold tracking-tight">
|
||||||
|
{t("sidebar.navigation")}
|
||||||
|
</h2>
|
||||||
{mainNavItems.map((item) => (
|
{mainNavItems.map((item) => (
|
||||||
<button
|
<button
|
||||||
key={item.href}
|
key={item.href}
|
||||||
@@ -206,13 +210,19 @@ export function Sidebar({ isOpen, onClose }: SidebarProps) {
|
|||||||
<div className="px-3 py-2">
|
<div className="px-3 py-2">
|
||||||
<div className="space-y-1">
|
<div className="space-y-1">
|
||||||
<div className="mb-2 px-4 flex items-center justify-between">
|
<div className="mb-2 px-4 flex items-center justify-between">
|
||||||
<h2 className="text-lg font-semibold tracking-tight">Favoris</h2>
|
<h2 className="text-lg font-semibold tracking-tight">
|
||||||
|
{t("sidebar.favorites.title")}
|
||||||
|
</h2>
|
||||||
<span className="text-xs text-muted-foreground">{favorites.length}</span>
|
<span className="text-xs text-muted-foreground">{favorites.length}</span>
|
||||||
</div>
|
</div>
|
||||||
{isLoadingFavorites ? (
|
{isLoadingFavorites ? (
|
||||||
<div className="px-3 py-2 text-sm text-muted-foreground">Chargement...</div>
|
<div className="px-3 py-2 text-sm text-muted-foreground">
|
||||||
|
{t("sidebar.favorites.loading")}
|
||||||
|
</div>
|
||||||
) : favorites.length === 0 ? (
|
) : favorites.length === 0 ? (
|
||||||
<div className="px-3 py-2 text-sm text-muted-foreground">Aucun favori</div>
|
<div className="px-3 py-2 text-sm text-muted-foreground">
|
||||||
|
{t("sidebar.favorites.empty")}
|
||||||
|
</div>
|
||||||
) : (
|
) : (
|
||||||
favorites.map((series) => (
|
favorites.map((series) => (
|
||||||
<button
|
<button
|
||||||
@@ -234,20 +244,26 @@ export function Sidebar({ isOpen, onClose }: SidebarProps) {
|
|||||||
<div className="px-3 py-2">
|
<div className="px-3 py-2">
|
||||||
<div className="space-y-1">
|
<div className="space-y-1">
|
||||||
<div className="mb-2 px-4 flex items-center justify-between">
|
<div className="mb-2 px-4 flex items-center justify-between">
|
||||||
<h2 className="text-lg font-semibold tracking-tight">Bibliothèques</h2>
|
<h2 className="text-lg font-semibold tracking-tight">
|
||||||
|
{t("sidebar.libraries.title")}
|
||||||
|
</h2>
|
||||||
<button
|
<button
|
||||||
onClick={handleRefresh}
|
onClick={handleRefresh}
|
||||||
disabled={isRefreshing}
|
disabled={isRefreshing}
|
||||||
className="p-1 hover:bg-accent hover:text-accent-foreground rounded-md transition-colors"
|
className="p-1 hover:bg-accent hover:text-accent-foreground rounded-md transition-colors"
|
||||||
aria-label="Rafraîchir les bibliothèques"
|
aria-label={t("sidebar.libraries.refresh")}
|
||||||
>
|
>
|
||||||
<RefreshCw className={cn("h-4 w-4", isRefreshing && "animate-spin")} />
|
<RefreshCw className={cn("h-4 w-4", isRefreshing && "animate-spin")} />
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
{isLoading ? (
|
{isLoading ? (
|
||||||
<div className="px-3 py-2 text-sm text-muted-foreground">Chargement...</div>
|
<div className="px-3 py-2 text-sm text-muted-foreground">
|
||||||
|
{t("sidebar.libraries.loading")}
|
||||||
|
</div>
|
||||||
) : libraries.length === 0 ? (
|
) : libraries.length === 0 ? (
|
||||||
<div className="px-3 py-2 text-sm text-muted-foreground">Aucune bibliothèque</div>
|
<div className="px-3 py-2 text-sm text-muted-foreground">
|
||||||
|
{t("sidebar.libraries.empty")}
|
||||||
|
</div>
|
||||||
) : (
|
) : (
|
||||||
libraries.map((library) => (
|
libraries.map((library) => (
|
||||||
<button
|
<button
|
||||||
@@ -268,7 +284,9 @@ export function Sidebar({ isOpen, onClose }: SidebarProps) {
|
|||||||
|
|
||||||
<div className="px-3 py-2">
|
<div className="px-3 py-2">
|
||||||
<div className="space-y-1">
|
<div className="space-y-1">
|
||||||
<h2 className="mb-2 px-4 text-lg font-semibold tracking-tight">Configuration</h2>
|
<h2 className="mb-2 px-4 text-lg font-semibold tracking-tight">
|
||||||
|
{t("sidebar.settings.title")}
|
||||||
|
</h2>
|
||||||
<button
|
<button
|
||||||
onClick={() => handleLinkClick("/settings")}
|
onClick={() => handleLinkClick("/settings")}
|
||||||
className={cn(
|
className={cn(
|
||||||
@@ -277,7 +295,7 @@ export function Sidebar({ isOpen, onClose }: SidebarProps) {
|
|||||||
)}
|
)}
|
||||||
>
|
>
|
||||||
<Settings className="mr-2 h-4 w-4" />
|
<Settings className="mr-2 h-4 w-4" />
|
||||||
Préférences
|
{t("sidebar.settings.preferences")}
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -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"
|
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"
|
||||||
>
|
>
|
||||||
<LogOut className="mr-2 h-4 w-4" />
|
<LogOut className="mr-2 h-4 w-4" />
|
||||||
Se déconnecter
|
{t("sidebar.logout")}
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</aside>
|
</aside>
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ import { Switch } from "@/components/ui/switch";
|
|||||||
import { Label } from "@/components/ui/label";
|
import { Label } from "@/components/ui/label";
|
||||||
import { CacheModeSwitch } from "@/components/settings/CacheModeSwitch";
|
import { CacheModeSwitch } from "@/components/settings/CacheModeSwitch";
|
||||||
import { KomgaConfig, TTLConfigData } from "@/types/komga";
|
import { KomgaConfig, TTLConfigData } from "@/types/komga";
|
||||||
|
import { useTranslate } from "@/hooks/useTranslate";
|
||||||
|
|
||||||
interface ClientSettingsProps {
|
interface ClientSettingsProps {
|
||||||
initialConfig: KomgaConfig | null;
|
initialConfig: KomgaConfig | null;
|
||||||
@@ -17,6 +18,7 @@ interface ClientSettingsProps {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function ClientSettings({ initialConfig, initialTTLConfig }: ClientSettingsProps) {
|
export function ClientSettings({ initialConfig, initialTTLConfig }: ClientSettingsProps) {
|
||||||
|
const { t } = useTranslate();
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const { toast } = useToast();
|
const { toast } = useToast();
|
||||||
const [isLoading, setIsLoading] = useState(false);
|
const [isLoading, setIsLoading] = useState(false);
|
||||||
@@ -64,8 +66,8 @@ export function ClientSettings({ initialConfig, initialTTLConfig }: ClientSettin
|
|||||||
}
|
}
|
||||||
|
|
||||||
toast({
|
toast({
|
||||||
title: "Cache supprimé",
|
title: t("settings.cache.title"),
|
||||||
description: "Cache serveur supprimé avec succès",
|
description: t("settings.cache.messages.cleared"),
|
||||||
});
|
});
|
||||||
router.refresh();
|
router.refresh();
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
@@ -110,8 +112,8 @@ export function ClientSettings({ initialConfig, initialTTLConfig }: ClientSettin
|
|||||||
}
|
}
|
||||||
|
|
||||||
toast({
|
toast({
|
||||||
title: "Connexion réussie",
|
title: t("settings.komga.title"),
|
||||||
description: "La connexion au serveur Komga a été établie avec succès",
|
description: t("settings.komga.messages.connectionSuccess"),
|
||||||
});
|
});
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error("Erreur:", error);
|
console.error("Erreur:", error);
|
||||||
@@ -173,8 +175,8 @@ export function ClientSettings({ initialConfig, initialTTLConfig }: ClientSettin
|
|||||||
setIsEditingConfig(false);
|
setIsEditingConfig(false);
|
||||||
|
|
||||||
toast({
|
toast({
|
||||||
title: "Configuration sauvegardée",
|
title: t("settings.komga.title"),
|
||||||
description: "La configuration a été sauvegardée avec succès",
|
description: t("settings.komga.messages.configSaved"),
|
||||||
});
|
});
|
||||||
|
|
||||||
// Forcer un rechargement complet de la page
|
// Forcer un rechargement complet de la page
|
||||||
@@ -227,8 +229,8 @@ export function ClientSettings({ initialConfig, initialTTLConfig }: ClientSettin
|
|||||||
}
|
}
|
||||||
|
|
||||||
toast({
|
toast({
|
||||||
title: "Configuration TTL sauvegardée",
|
title: t("settings.cache.title"),
|
||||||
description: "La configuration des TTL a été sauvegardée avec succès",
|
description: t("settings.cache.messages.ttlSaved"),
|
||||||
});
|
});
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error("Erreur lors de la sauvegarde:", error);
|
console.error("Erreur lors de la sauvegarde:", error);
|
||||||
@@ -245,8 +247,8 @@ export function ClientSettings({ initialConfig, initialTTLConfig }: ClientSettin
|
|||||||
try {
|
try {
|
||||||
await updatePreferences({ showThumbnails: checked });
|
await updatePreferences({ showThumbnails: checked });
|
||||||
toast({
|
toast({
|
||||||
title: "Préférences sauvegardées",
|
title: t("settings.title"),
|
||||||
description: "Les préférences ont été mises à jour avec succès",
|
description: t("settings.komga.messages.configSaved"),
|
||||||
});
|
});
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
toast({
|
toast({
|
||||||
@@ -263,7 +265,7 @@ export function ClientSettings({ initialConfig, initialTTLConfig }: ClientSettin
|
|||||||
return (
|
return (
|
||||||
<div className="container max-w-3xl mx-auto py-8 space-y-6">
|
<div className="container max-w-3xl mx-auto py-8 space-y-6">
|
||||||
<div className="flex items-center justify-between">
|
<div className="flex items-center justify-between">
|
||||||
<h1 className="text-3xl font-bold">Préférences</h1>
|
<h1 className="text-3xl font-bold">{t("settings.title")}</h1>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Messages de succès/erreur */}
|
{/* Messages de succès/erreur */}
|
||||||
@@ -284,19 +286,19 @@ export function ClientSettings({ initialConfig, initialTTLConfig }: ClientSettin
|
|||||||
<div className="p-5 space-y-4">
|
<div className="p-5 space-y-4">
|
||||||
<div>
|
<div>
|
||||||
<h2 className="text-xl font-semibold flex items-center gap-2">
|
<h2 className="text-xl font-semibold flex items-center gap-2">
|
||||||
Préférences d'affichage
|
{t("settings.display.title")}
|
||||||
</h2>
|
</h2>
|
||||||
<p className="text-sm text-muted-foreground mt-1">
|
<p className="text-sm text-muted-foreground mt-1">
|
||||||
Personnalisez l'affichage de votre bibliothèque.
|
{t("settings.display.description")}
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="space-y-4">
|
<div className="space-y-4">
|
||||||
<div className="flex items-center justify-between">
|
<div className="flex items-center justify-between">
|
||||||
<div className="space-y-0.5">
|
<div className="space-y-0.5">
|
||||||
<Label htmlFor="thumbnails">Afficher les vignettes</Label>
|
<Label htmlFor="thumbnails">{t("settings.display.thumbnails.label")}</Label>
|
||||||
<p className="text-sm text-muted-foreground">
|
<p className="text-sm text-muted-foreground">
|
||||||
Utiliser les vignettes au lieu des premières pages pour l'affichage des séries
|
{t("settings.display.thumbnails.description")}
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<Switch
|
<Switch
|
||||||
@@ -307,9 +309,9 @@ export function ClientSettings({ initialConfig, initialTTLConfig }: ClientSettin
|
|||||||
</div>
|
</div>
|
||||||
<div className="flex items-center justify-between">
|
<div className="flex items-center justify-between">
|
||||||
<div className="space-y-0.5">
|
<div className="space-y-0.5">
|
||||||
<Label htmlFor="unread-filter">Filtre "À lire" par défaut</Label>
|
<Label htmlFor="unread-filter">{t("settings.display.unreadFilter.label")}</Label>
|
||||||
<p className="text-sm text-muted-foreground">
|
<p className="text-sm text-muted-foreground">
|
||||||
Afficher uniquement les séries non lues par défaut
|
{t("settings.display.unreadFilter.description")}
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<Switch
|
<Switch
|
||||||
@@ -319,10 +321,8 @@ export function ClientSettings({ initialConfig, initialTTLConfig }: ClientSettin
|
|||||||
try {
|
try {
|
||||||
await updatePreferences({ showOnlyUnread: checked });
|
await updatePreferences({ showOnlyUnread: checked });
|
||||||
toast({
|
toast({
|
||||||
title: "Préférences sauvegardées",
|
title: t("settings.title"),
|
||||||
description: `Le filtre "À lire" par défaut est maintenant ${
|
description: t("settings.komga.messages.configSaved"),
|
||||||
checked ? "activé" : "désactivé"
|
|
||||||
}`,
|
|
||||||
});
|
});
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error("Erreur détaillée:", error);
|
console.error("Erreur détaillée:", error);
|
||||||
@@ -340,9 +340,9 @@ export function ClientSettings({ initialConfig, initialTTLConfig }: ClientSettin
|
|||||||
</div>
|
</div>
|
||||||
<div className="flex items-center justify-between">
|
<div className="flex items-center justify-between">
|
||||||
<div className="space-y-0.5">
|
<div className="space-y-0.5">
|
||||||
<Label htmlFor="debug-mode">Mode debug</Label>
|
<Label htmlFor="debug-mode">{t("settings.display.debugMode.label")}</Label>
|
||||||
<p className="text-sm text-muted-foreground">
|
<p className="text-sm text-muted-foreground">
|
||||||
Afficher les informations de debug dans l'interface
|
{t("settings.display.debugMode.description")}
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<Switch
|
<Switch
|
||||||
@@ -352,10 +352,8 @@ export function ClientSettings({ initialConfig, initialTTLConfig }: ClientSettin
|
|||||||
try {
|
try {
|
||||||
await updatePreferences({ debug: checked });
|
await updatePreferences({ debug: checked });
|
||||||
toast({
|
toast({
|
||||||
title: "Préférences sauvegardées",
|
title: t("settings.title"),
|
||||||
description: `Le mode debug est maintenant ${
|
description: t("settings.komga.messages.configSaved"),
|
||||||
checked ? "activé" : "désactivé"
|
|
||||||
}`,
|
|
||||||
});
|
});
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error("Erreur détaillée:", error);
|
console.error("Erreur détaillée:", error);
|
||||||
@@ -381,10 +379,10 @@ export function ClientSettings({ initialConfig, initialTTLConfig }: ClientSettin
|
|||||||
<div>
|
<div>
|
||||||
<h2 className="text-xl font-semibold flex items-center gap-2">
|
<h2 className="text-xl font-semibold flex items-center gap-2">
|
||||||
<Network className="h-5 w-5" />
|
<Network className="h-5 w-5" />
|
||||||
Configuration Komga
|
{t("settings.komga.title")}
|
||||||
</h2>
|
</h2>
|
||||||
<p className="text-sm text-muted-foreground mt-1">
|
<p className="text-sm text-muted-foreground mt-1">
|
||||||
Configurez les informations de connexion à votre serveur Komga.
|
{t("settings.komga.description")}
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -392,15 +390,15 @@ export function ClientSettings({ initialConfig, initialTTLConfig }: ClientSettin
|
|||||||
<div className="space-y-4">
|
<div className="space-y-4">
|
||||||
<div className="space-y-3">
|
<div className="space-y-3">
|
||||||
<div className="space-y-2">
|
<div className="space-y-2">
|
||||||
<label className="text-sm font-medium">L'URL du serveur</label>
|
<label className="text-sm font-medium">{t("settings.komga.serverUrl")}</label>
|
||||||
<p className="text-sm text-muted-foreground">{config.serverUrl}</p>
|
<p className="text-sm text-muted-foreground">{config.serverUrl}</p>
|
||||||
</div>
|
</div>
|
||||||
<div className="space-y-2">
|
<div className="space-y-2">
|
||||||
<label className="text-sm font-medium">L'adresse email de connexion</label>
|
<label className="text-sm font-medium">{t("settings.komga.email")}</label>
|
||||||
<p className="text-sm text-muted-foreground">{config.username}</p>
|
<p className="text-sm text-muted-foreground">{config.username}</p>
|
||||||
</div>
|
</div>
|
||||||
<div className="space-y-2">
|
<div className="space-y-2">
|
||||||
<label className="text-sm font-medium">Mot de passe</label>
|
<label className="text-sm font-medium">{t("settings.komga.password")}</label>
|
||||||
<p className="text-sm text-muted-foreground">••••••••</p>
|
<p className="text-sm text-muted-foreground">••••••••</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -409,7 +407,7 @@ export function ClientSettings({ initialConfig, initialTTLConfig }: ClientSettin
|
|||||||
onClick={() => setIsEditingConfig(true)}
|
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"
|
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")}
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
) : (
|
) : (
|
||||||
@@ -417,7 +415,7 @@ export function ClientSettings({ initialConfig, initialTTLConfig }: ClientSettin
|
|||||||
<div className="space-y-3">
|
<div className="space-y-3">
|
||||||
<div className="space-y-2">
|
<div className="space-y-2">
|
||||||
<label htmlFor="serverUrl" className="text-sm font-medium">
|
<label htmlFor="serverUrl" className="text-sm font-medium">
|
||||||
L'URL du serveur
|
{t("settings.komga.serverUrl")}
|
||||||
</label>
|
</label>
|
||||||
<input
|
<input
|
||||||
type="url"
|
type="url"
|
||||||
@@ -431,7 +429,7 @@ export function ClientSettings({ initialConfig, initialTTLConfig }: ClientSettin
|
|||||||
</div>
|
</div>
|
||||||
<div className="space-y-2">
|
<div className="space-y-2">
|
||||||
<label htmlFor="username" className="text-sm font-medium">
|
<label htmlFor="username" className="text-sm font-medium">
|
||||||
L'adresse email de connexion
|
{t("settings.komga.email")}
|
||||||
</label>
|
</label>
|
||||||
<input
|
<input
|
||||||
type="text"
|
type="text"
|
||||||
@@ -445,7 +443,7 @@ export function ClientSettings({ initialConfig, initialTTLConfig }: ClientSettin
|
|||||||
</div>
|
</div>
|
||||||
<div className="space-y-2">
|
<div className="space-y-2">
|
||||||
<label htmlFor="password" className="text-sm font-medium">
|
<label htmlFor="password" className="text-sm font-medium">
|
||||||
Mot de passe
|
{t("settings.komga.password")}
|
||||||
</label>
|
</label>
|
||||||
<input
|
<input
|
||||||
type="password"
|
type="password"
|
||||||
@@ -467,10 +465,10 @@ export function ClientSettings({ initialConfig, initialTTLConfig }: ClientSettin
|
|||||||
{isSaving ? (
|
{isSaving ? (
|
||||||
<>
|
<>
|
||||||
<Loader2 className="mr-2 h-4 w-4 animate-spin" />
|
<Loader2 className="mr-2 h-4 w-4 animate-spin" />
|
||||||
Sauvegarde...
|
{t("settings.komga.buttons.saving")}
|
||||||
</>
|
</>
|
||||||
) : (
|
) : (
|
||||||
"Sauvegarder"
|
t("settings.komga.buttons.save")
|
||||||
)}
|
)}
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
@@ -482,10 +480,10 @@ export function ClientSettings({ initialConfig, initialTTLConfig }: ClientSettin
|
|||||||
{isLoading ? (
|
{isLoading ? (
|
||||||
<>
|
<>
|
||||||
<Loader2 className="mr-2 h-4 w-4 animate-spin" />
|
<Loader2 className="mr-2 h-4 w-4 animate-spin" />
|
||||||
Test en cours...
|
{t("settings.komga.buttons.testing")}
|
||||||
</>
|
</>
|
||||||
) : (
|
) : (
|
||||||
"Tester la connexion"
|
t("settings.komga.buttons.test")
|
||||||
)}
|
)}
|
||||||
</button>
|
</button>
|
||||||
{initialConfig && (
|
{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"
|
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")}
|
||||||
</button>
|
</button>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
@@ -517,18 +515,18 @@ export function ClientSettings({ initialConfig, initialTTLConfig }: ClientSettin
|
|||||||
<div>
|
<div>
|
||||||
<h2 className="text-xl font-semibold flex items-center gap-2">
|
<h2 className="text-xl font-semibold flex items-center gap-2">
|
||||||
<Trash2 className="h-5 w-5" />
|
<Trash2 className="h-5 w-5" />
|
||||||
Configuration du Cache
|
{t("settings.cache.title")}
|
||||||
</h2>
|
</h2>
|
||||||
<p className="text-sm text-muted-foreground mt-1">
|
<p className="text-sm text-muted-foreground mt-1">
|
||||||
Gérez les paramètres de mise en cache des données.
|
{t("settings.cache.description")}
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="flex items-center justify-between mb-4">
|
<div className="flex items-center justify-between mb-4">
|
||||||
<div className="space-y-0.5">
|
<div className="space-y-0.5">
|
||||||
<Label htmlFor="cache-mode">Mode de cache</Label>
|
<Label htmlFor="cache-mode">{t("settings.cache.mode.label")}</Label>
|
||||||
<p className="text-sm text-muted-foreground">
|
<p className="text-sm text-muted-foreground">
|
||||||
Le cache en mémoire est plus rapide mais ne persiste pas entre les redémarrages
|
{t("settings.cache.mode.description")}
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<CacheModeSwitch />
|
<CacheModeSwitch />
|
||||||
@@ -539,7 +537,7 @@ export function ClientSettings({ initialConfig, initialTTLConfig }: ClientSettin
|
|||||||
<div className="grid gap-3 sm:grid-cols-2">
|
<div className="grid gap-3 sm:grid-cols-2">
|
||||||
<div className="space-y-2">
|
<div className="space-y-2">
|
||||||
<label htmlFor="defaultTTL" className="text-sm font-medium">
|
<label htmlFor="defaultTTL" className="text-sm font-medium">
|
||||||
TTL par défaut (minutes)
|
{t("settings.cache.ttl.default")}
|
||||||
</label>
|
</label>
|
||||||
<input
|
<input
|
||||||
type="number"
|
type="number"
|
||||||
@@ -553,7 +551,7 @@ export function ClientSettings({ initialConfig, initialTTLConfig }: ClientSettin
|
|||||||
</div>
|
</div>
|
||||||
<div className="space-y-2">
|
<div className="space-y-2">
|
||||||
<label htmlFor="homeTTL" className="text-sm font-medium">
|
<label htmlFor="homeTTL" className="text-sm font-medium">
|
||||||
TTL page d'accueil
|
{t("settings.cache.ttl.home")}
|
||||||
</label>
|
</label>
|
||||||
<input
|
<input
|
||||||
type="number"
|
type="number"
|
||||||
@@ -567,7 +565,7 @@ export function ClientSettings({ initialConfig, initialTTLConfig }: ClientSettin
|
|||||||
</div>
|
</div>
|
||||||
<div className="space-y-2">
|
<div className="space-y-2">
|
||||||
<label htmlFor="librariesTTL" className="text-sm font-medium">
|
<label htmlFor="librariesTTL" className="text-sm font-medium">
|
||||||
TTL bibliothèques
|
{t("settings.cache.ttl.libraries")}
|
||||||
</label>
|
</label>
|
||||||
<input
|
<input
|
||||||
type="number"
|
type="number"
|
||||||
@@ -581,7 +579,7 @@ export function ClientSettings({ initialConfig, initialTTLConfig }: ClientSettin
|
|||||||
</div>
|
</div>
|
||||||
<div className="space-y-2">
|
<div className="space-y-2">
|
||||||
<label htmlFor="seriesTTL" className="text-sm font-medium">
|
<label htmlFor="seriesTTL" className="text-sm font-medium">
|
||||||
TTL séries
|
{t("settings.cache.ttl.series")}
|
||||||
</label>
|
</label>
|
||||||
<input
|
<input
|
||||||
type="number"
|
type="number"
|
||||||
@@ -595,7 +593,7 @@ export function ClientSettings({ initialConfig, initialTTLConfig }: ClientSettin
|
|||||||
</div>
|
</div>
|
||||||
<div className="space-y-2">
|
<div className="space-y-2">
|
||||||
<label htmlFor="booksTTL" className="text-sm font-medium">
|
<label htmlFor="booksTTL" className="text-sm font-medium">
|
||||||
TTL tomes
|
{t("settings.cache.ttl.books")}
|
||||||
</label>
|
</label>
|
||||||
<input
|
<input
|
||||||
type="number"
|
type="number"
|
||||||
@@ -609,7 +607,7 @@ export function ClientSettings({ initialConfig, initialTTLConfig }: ClientSettin
|
|||||||
</div>
|
</div>
|
||||||
<div className="space-y-2">
|
<div className="space-y-2">
|
||||||
<label htmlFor="imagesTTL" className="text-sm font-medium">
|
<label htmlFor="imagesTTL" className="text-sm font-medium">
|
||||||
TTL images
|
{t("settings.cache.ttl.images")}
|
||||||
</label>
|
</label>
|
||||||
<input
|
<input
|
||||||
type="number"
|
type="number"
|
||||||
@@ -627,7 +625,7 @@ export function ClientSettings({ initialConfig, initialTTLConfig }: ClientSettin
|
|||||||
type="submit"
|
type="submit"
|
||||||
className="flex-1 inline-flex items-center justify-center rounded-md bg-primary px-3 py-2 text-sm font-medium text-primary-foreground ring-offset-background transition-colors hover:bg-primary/90 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50"
|
className="flex-1 inline-flex items-center justify-center rounded-md bg-primary px-3 py-2 text-sm font-medium text-primary-foreground ring-offset-background transition-colors hover:bg-primary/90 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50"
|
||||||
>
|
>
|
||||||
Sauvegarder les TTL
|
{t("settings.cache.buttons.saveTTL")}
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
@@ -638,10 +636,10 @@ export function ClientSettings({ initialConfig, initialTTLConfig }: ClientSettin
|
|||||||
{isCacheClearing ? (
|
{isCacheClearing ? (
|
||||||
<>
|
<>
|
||||||
<Loader2 className="mr-2 h-4 w-4 animate-spin" />
|
<Loader2 className="mr-2 h-4 w-4 animate-spin" />
|
||||||
Suppression...
|
{t("settings.cache.buttons.clearing")}
|
||||||
</>
|
</>
|
||||||
) : (
|
) : (
|
||||||
"Vider le cache"
|
t("settings.cache.buttons.clear")
|
||||||
)}
|
)}
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -27,5 +27,89 @@
|
|||||||
"latest_series": "Latest series",
|
"latest_series": "Latest series",
|
||||||
"recently_added": "Recently added"
|
"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"
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -27,5 +27,89 @@
|
|||||||
"latest_series": "Dernières séries",
|
"latest_series": "Dernières séries",
|
||||||
"recently_added": "Ajouts récents"
|
"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"
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user