diff --git a/front/.eslintrc.json b/front/.eslintrc.json index 750b2972..9e486812 100755 --- a/front/.eslintrc.json +++ b/front/.eslintrc.json @@ -2,6 +2,7 @@ "extends": ["next/core-web-vitals", "prettier"], "plugins": ["header"], "rules": { + "@next/next/no-img-element": "off", "header/header": [ "error", "block", diff --git a/front/locales/en/browse.json b/front/locales/en/browse.json index baefbd39..2b365d6f 100644 --- a/front/locales/en/browse.json +++ b/front/locales/en/browse.json @@ -13,6 +13,7 @@ }, "browse": { "sortby": "Sort by {{key}}", + "sortby-tt": "Sort by", "sortkey": { "name": "Name", "startAir": "Start air", @@ -21,6 +22,12 @@ "sortord": { "asc": "asc", "desc": "decs" - } + }, + "switchToGrid": "Switch to grid view", + "switchToList": "Switch to list view" + }, + "misc": { + "prev-page": "Previous page", + "next-page": "Next page" } } diff --git a/front/locales/fr/browse.json b/front/locales/fr/browse.json index 21eea5c3..cbe5eeec 100644 --- a/front/locales/fr/browse.json +++ b/front/locales/fr/browse.json @@ -8,11 +8,12 @@ "staff": "Staff", "staff-none": "Aucun membre du staff connu", "noOverview": "Aucune description disponible", - "episode-none": "Il n'y a pas d'episodes dans cette saison", + "episode-none": "Il n'y a pas d'épisodes dans cette saison", "episodeNoMetadata": "Aucune metadonnée disponible" }, "browse": { "sortby": "Trier par {{key}}", + "sortby-tt": "Trier par", "sortkey": { "name": "Nom", "startAir": "Date de sortie", @@ -21,6 +22,12 @@ "sortord": { "asc": "asc", "desc": "decs" - } + }, + "switchToGrid": "Passer en vue grille", + "switchToList": "Passer en vue liste" + }, + "misc": { + "prev-page": "Page précédente", + "next-page": "Page suivante" } } diff --git a/front/next.config.js b/front/next.config.js index d3a25a4b..2b71b9a7 100755 --- a/front/next.config.js +++ b/front/next.config.js @@ -34,6 +34,10 @@ const nextConfig = { }, ]; }, + i18n: { + locales: ["en", "fr"], + defaultLocale: "en", + }, }; if (process.env.NODE_ENV !== "production") { diff --git a/front/src/components/horizontal-list.tsx b/front/src/components/horizontal-list.tsx index 4580b83d..175445bb 100644 --- a/front/src/components/horizontal-list.tsx +++ b/front/src/components/horizontal-list.tsx @@ -19,11 +19,13 @@ */ import { ArrowLeft, ArrowRight } from "@mui/icons-material"; -import { Box, IconButton, Typography } from "@mui/material"; +import { Box, IconButton, Tooltip, Typography } from "@mui/material"; import { ReactNode, useRef } from "react"; import { Container } from "./container"; +import useTranslation from "next-translate/useTranslation"; export const HorizontalList = ({ title, noContent, children }: { title: string, noContent: string, children: ReactNode[] }) => { + const { t } = useTranslation("browse"); const ref = useRef(null); const getScrollSize = () => { const childSize = ref.current?.children[0].clientWidth; @@ -39,38 +41,42 @@ export const HorizontalList = ({ title, noContent, children }: { title: string, <> + > {title} - ref.current?.scrollBy({ left: -getScrollSize(), behavior: "smooth" })}> - - - ref.current?.scrollBy({ left: getScrollSize(), behavior: "smooth" })}> - - + + ref.current?.scrollBy({ left: -getScrollSize(), behavior: "smooth" })}> + + + + + ref.current?.scrollBy({ left: getScrollSize(), behavior: "smooth" })}> + + + {children.length == 0 ? ( {noContent} - ) : ( - + ) : ( + {children} - + )} ); diff --git a/front/src/components/navbar.tsx b/front/src/components/navbar.tsx index 0563b77a..6da54820 100644 --- a/front/src/components/navbar.tsx +++ b/front/src/components/navbar.tsx @@ -32,7 +32,6 @@ import { AppBarProps, } from "@mui/material"; import MenuIcon from "@mui/icons-material/Menu"; -/* import logo from "../public/icons/icon.svg"; */ import useTranslation from "next-translate/useTranslation"; import Image from "next/image"; import { ButtonLink } from "~/utils/link"; @@ -55,7 +54,7 @@ const KyooTitle = (props: { sx: SxProps }) => { }} href="/" > - + . */ -import { - FilterList, - GridView, - North, - Sort, - South, - ViewList, -} from "@mui/icons-material"; +import { FilterList, GridView, North, Sort, South, ViewList } from "@mui/icons-material"; import { Box, Button, @@ -36,6 +29,7 @@ import { Menu, Skeleton, Divider, + Tooltip, Typography, } from "@mui/material"; import useTranslation from "next-translate/useTranslation"; @@ -253,6 +247,8 @@ const BrowseSettings = ({ const router = useRouter(); const { t } = useTranslation("browse"); + const switchViewTitle = layout === Layout.Grid ? t("browse.switchToList") : t("browse.switchToGrid"); + return ( <> @@ -260,20 +256,28 @@ const BrowseSettings = ({ - - + + + + + + { {data?.name ?? } {(!data || getDisplayDate(data)) && ( - + {data != undefined ? ( getDisplayDate(data) ) : (