feat(i18n): controlbutton
This commit is contained in:
@@ -12,6 +12,7 @@ import {
|
||||
} from "lucide-react";
|
||||
import { cn } from "@/lib/utils";
|
||||
import { PageInput } from "./PageInput";
|
||||
import { useTranslation } from "react-i18next";
|
||||
|
||||
export const ControlButtons = ({
|
||||
showControls,
|
||||
@@ -29,6 +30,8 @@ export const ControlButtons = ({
|
||||
onToggleDirection,
|
||||
onPageChange,
|
||||
}: ControlButtonsProps) => {
|
||||
const { t } = useTranslation();
|
||||
|
||||
return (
|
||||
<>
|
||||
{/* Boutons de contrôle */}
|
||||
@@ -48,9 +51,11 @@ export const ControlButtons = ({
|
||||
onToggleDoublePage();
|
||||
}}
|
||||
className="p-2 rounded-full bg-background/50 hover:bg-background/80 transition-colors"
|
||||
aria-label={
|
||||
isDoublePage ? "Désactiver le mode double page" : "Activer le mode double page"
|
||||
}
|
||||
aria-label={t(
|
||||
isDoublePage
|
||||
? "reader.controls.doublePage.disable"
|
||||
: "reader.controls.doublePage.enable"
|
||||
)}
|
||||
>
|
||||
{isDoublePage ? (
|
||||
<LayoutTemplate className="h-6 w-6" />
|
||||
@@ -64,9 +69,13 @@ export const ControlButtons = ({
|
||||
onToggleDirection();
|
||||
}}
|
||||
className="p-2 rounded-full bg-background/50 hover:bg-background/80 transition-colors"
|
||||
aria-label={`Changer le sens de lecture (actuellement de ${
|
||||
direction === "ltr" ? "gauche à droite" : "droite à gauche"
|
||||
})`}
|
||||
aria-label={t("reader.controls.direction.current", {
|
||||
direction: t(
|
||||
direction === "ltr"
|
||||
? "reader.controls.direction.ltr"
|
||||
: "reader.controls.direction.rtl"
|
||||
),
|
||||
})}
|
||||
>
|
||||
{direction === "rtl" ? (
|
||||
<MoveLeft className="h-6 w-6" />
|
||||
@@ -80,7 +89,9 @@ export const ControlButtons = ({
|
||||
onToggleFullscreen();
|
||||
}}
|
||||
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" />}
|
||||
</button>
|
||||
|
||||
@@ -263,5 +263,22 @@
|
||||
"BOOK_PAGES_FETCH_ERROR": "Error fetching book pages",
|
||||
|
||||
"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",
|
||||
|
||||
"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