feat(i18n): controlbutton
This commit is contained in:
@@ -12,6 +12,7 @@ import {
|
|||||||
} from "lucide-react";
|
} from "lucide-react";
|
||||||
import { cn } from "@/lib/utils";
|
import { cn } from "@/lib/utils";
|
||||||
import { PageInput } from "./PageInput";
|
import { PageInput } from "./PageInput";
|
||||||
|
import { useTranslation } from "react-i18next";
|
||||||
|
|
||||||
export const ControlButtons = ({
|
export const ControlButtons = ({
|
||||||
showControls,
|
showControls,
|
||||||
@@ -29,6 +30,8 @@ export const ControlButtons = ({
|
|||||||
onToggleDirection,
|
onToggleDirection,
|
||||||
onPageChange,
|
onPageChange,
|
||||||
}: ControlButtonsProps) => {
|
}: ControlButtonsProps) => {
|
||||||
|
const { t } = useTranslation();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
{/* Boutons de contrôle */}
|
{/* Boutons de contrôle */}
|
||||||
@@ -48,9 +51,11 @@ export const ControlButtons = ({
|
|||||||
onToggleDoublePage();
|
onToggleDoublePage();
|
||||||
}}
|
}}
|
||||||
className="p-2 rounded-full bg-background/50 hover:bg-background/80 transition-colors"
|
className="p-2 rounded-full bg-background/50 hover:bg-background/80 transition-colors"
|
||||||
aria-label={
|
aria-label={t(
|
||||||
isDoublePage ? "Désactiver le mode double page" : "Activer le mode double page"
|
isDoublePage
|
||||||
}
|
? "reader.controls.doublePage.disable"
|
||||||
|
: "reader.controls.doublePage.enable"
|
||||||
|
)}
|
||||||
>
|
>
|
||||||
{isDoublePage ? (
|
{isDoublePage ? (
|
||||||
<LayoutTemplate className="h-6 w-6" />
|
<LayoutTemplate className="h-6 w-6" />
|
||||||
@@ -64,9 +69,13 @@ export const ControlButtons = ({
|
|||||||
onToggleDirection();
|
onToggleDirection();
|
||||||
}}
|
}}
|
||||||
className="p-2 rounded-full bg-background/50 hover:bg-background/80 transition-colors"
|
className="p-2 rounded-full bg-background/50 hover:bg-background/80 transition-colors"
|
||||||
aria-label={`Changer le sens de lecture (actuellement de ${
|
aria-label={t("reader.controls.direction.current", {
|
||||||
direction === "ltr" ? "gauche à droite" : "droite à gauche"
|
direction: t(
|
||||||
})`}
|
direction === "ltr"
|
||||||
|
? "reader.controls.direction.ltr"
|
||||||
|
: "reader.controls.direction.rtl"
|
||||||
|
),
|
||||||
|
})}
|
||||||
>
|
>
|
||||||
{direction === "rtl" ? (
|
{direction === "rtl" ? (
|
||||||
<MoveLeft className="h-6 w-6" />
|
<MoveLeft className="h-6 w-6" />
|
||||||
@@ -80,7 +89,9 @@ export const ControlButtons = ({
|
|||||||
onToggleFullscreen();
|
onToggleFullscreen();
|
||||||
}}
|
}}
|
||||||
className="p-2 rounded-full bg-background/50 hover:bg-background/80 transition-colors"
|
className="p-2 rounded-full bg-background/50 hover:bg-background/80 transition-colors"
|
||||||
aria-label={isFullscreen ? "Quitter le plein écran" : "Plein écran"}
|
aria-label={t(
|
||||||
|
isFullscreen ? "reader.controls.fullscreen.exit" : "reader.controls.fullscreen.enter"
|
||||||
|
)}
|
||||||
>
|
>
|
||||||
{isFullscreen ? <Minimize2 className="h-6 w-6" /> : <Maximize2 className="h-6 w-6" />}
|
{isFullscreen ? <Minimize2 className="h-6 w-6" /> : <Maximize2 className="h-6 w-6" />}
|
||||||
</button>
|
</button>
|
||||||
|
|||||||
@@ -263,5 +263,22 @@
|
|||||||
"BOOK_PAGES_FETCH_ERROR": "Error fetching book pages",
|
"BOOK_PAGES_FETCH_ERROR": "Error fetching book pages",
|
||||||
|
|
||||||
"GENERIC_ERROR": "An error occurred"
|
"GENERIC_ERROR": "An error occurred"
|
||||||
|
},
|
||||||
|
"reader": {
|
||||||
|
"controls": {
|
||||||
|
"doublePage": {
|
||||||
|
"enable": "Enable double page mode",
|
||||||
|
"disable": "Disable double page mode"
|
||||||
|
},
|
||||||
|
"direction": {
|
||||||
|
"current": "Change reading direction (currently {{direction}})",
|
||||||
|
"ltr": "left to right",
|
||||||
|
"rtl": "right to left"
|
||||||
|
},
|
||||||
|
"fullscreen": {
|
||||||
|
"enter": "Enter fullscreen",
|
||||||
|
"exit": "Exit fullscreen"
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -263,5 +263,22 @@
|
|||||||
"BOOK_PAGES_FETCH_ERROR": "Erreur lors de la récupération des pages du livre",
|
"BOOK_PAGES_FETCH_ERROR": "Erreur lors de la récupération des pages du livre",
|
||||||
|
|
||||||
"GENERIC_ERROR": "Une erreur est survenue"
|
"GENERIC_ERROR": "Une erreur est survenue"
|
||||||
|
},
|
||||||
|
"reader": {
|
||||||
|
"controls": {
|
||||||
|
"doublePage": {
|
||||||
|
"enable": "Activer le mode double page",
|
||||||
|
"disable": "Désactiver le mode double page"
|
||||||
|
},
|
||||||
|
"direction": {
|
||||||
|
"current": "Changer le sens de lecture (actuellement de {{direction}})",
|
||||||
|
"ltr": "gauche à droite",
|
||||||
|
"rtl": "droite à gauche"
|
||||||
|
},
|
||||||
|
"fullscreen": {
|
||||||
|
"enter": "Plein écran",
|
||||||
|
"exit": "Quitter le plein écran"
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user