diff --git a/todoblue/src/app/(i18n)/client.ts b/todoblue/src/app/(i18n)/client.ts index 1971493..e50f65c 100644 --- a/todoblue/src/app/(i18n)/client.ts +++ b/todoblue/src/app/(i18n)/client.ts @@ -20,7 +20,7 @@ async function init(lng: string, ns: string): Promise { return instance } -export function useTranslation(lng: string, ns: string) { +export function useClientTranslation(lng: string, ns: string) { const [instance, setInstance] = useState(undefined); useEffect( diff --git a/todoblue/src/app/(i18n)/server.ts b/todoblue/src/app/(i18n)/server.ts index 6d03135..b82889c 100644 --- a/todoblue/src/app/(i18n)/server.ts +++ b/todoblue/src/app/(i18n)/server.ts @@ -18,7 +18,7 @@ async function init(lng: string, ns: string): Promise { return instance } -export async function useTranslation(lng: string, ns: string) { +export async function useServerTranslation(lng: string, ns: string) { const instance = await init(lng, ns) return { t: instance.getFixedT(lng, Array.isArray(ns) ? ns[0] : ns), diff --git a/todoblue/src/app/[lang]/(page)/CreateBoardChapter.tsx b/todoblue/src/app/[lang]/(page)/CreateBoardChapter.tsx index 8514c89..47679c1 100644 --- a/todoblue/src/app/[lang]/(page)/CreateBoardChapter.tsx +++ b/todoblue/src/app/[lang]/(page)/CreateBoardChapter.tsx @@ -1,11 +1,11 @@ -import {useTranslation} from "@/app/(i18n)/server" +import {useServerTranslation} from "@/app/(i18n)/server" import {CreatePrivateBoardPanel} from "@/app/[lang]/(page)/CreatePrivateBoardPanel" import {CreatePublicBoardPanel} from "@/app/[lang]/(page)/CreatePublicBoardPanel" import {default as React} from "react" export async function CreateBoardChapter({lng}: {lng: string}) { - const {t} = await useTranslation(lng, "root") + const {t} = await useServerTranslation(lng, "root") return (
diff --git a/todoblue/src/app/[lang]/(page)/CreatePrivateBoardPanel.tsx b/todoblue/src/app/[lang]/(page)/CreatePrivateBoardPanel.tsx index f676c52..ec8fbcf 100644 --- a/todoblue/src/app/[lang]/(page)/CreatePrivateBoardPanel.tsx +++ b/todoblue/src/app/[lang]/(page)/CreatePrivateBoardPanel.tsx @@ -1,6 +1,6 @@ "use client"; -import {useTranslation} from "@/app/(i18n)/client" +import {useClientTranslation} from "@/app/(i18n)/client" import {faLock} from "@fortawesome/free-solid-svg-icons" import {FontAwesomeIcon} from "@fortawesome/react-fontawesome" import classNames from "classnames" @@ -8,7 +8,7 @@ import {useRouter} from "next/navigation" import {default as React, SyntheticEvent, useCallback, useEffect, useState} from "react" export function CreatePrivateBoardPanel({lng}: {lng: string}) { - const {t} = useTranslation(lng, "root") + const {t} = useClientTranslation(lng, "root") const router = useRouter(); const [canCreate, setCanCreate] = useState(null); diff --git a/todoblue/src/app/[lang]/(page)/CreatePublicBoardPanel.tsx b/todoblue/src/app/[lang]/(page)/CreatePublicBoardPanel.tsx index 11c76ee..2e31379 100644 --- a/todoblue/src/app/[lang]/(page)/CreatePublicBoardPanel.tsx +++ b/todoblue/src/app/[lang]/(page)/CreatePublicBoardPanel.tsx @@ -1,6 +1,6 @@ "use client"; -import {useTranslation} from "@/app/(i18n)/client" +import {useClientTranslation} from "@/app/(i18n)/client" import {useLowerKebabState} from "@/app/[lang]/useKebabState" import {faGlobe} from "@fortawesome/free-solid-svg-icons" import cn from "classnames" @@ -10,7 +10,7 @@ import {FontAwesomeIcon} from "@fortawesome/react-fontawesome" export function CreatePublicBoardPanel({lng}: {lng: string}) { - const {t} = useTranslation(lng, "root") + const {t} = useClientTranslation(lng, "root") const [code, setCode] = useLowerKebabState("") const router = useRouter(); diff --git a/todoblue/src/app/[lang]/(page)/ExistingBoardChapter.tsx b/todoblue/src/app/[lang]/(page)/ExistingBoardChapter.tsx index fdf2e8a..7c76497 100644 --- a/todoblue/src/app/[lang]/(page)/ExistingBoardChapter.tsx +++ b/todoblue/src/app/[lang]/(page)/ExistingBoardChapter.tsx @@ -1,11 +1,11 @@ -import {useTranslation} from "@/app/(i18n)/server" +import {useServerTranslation} from "@/app/(i18n)/server" import {KnownBoardsPanel} from "@/app/[lang]/(page)/KnownBoardsPanel" import {StarredBoardsPanel} from "@/app/[lang]/(page)/StarredBoardsPanel" import {default as React} from "react" export async function ExistingBoardChapter({lng}: {lng: string}) { - const {t} = await useTranslation(lng, "root") + const {t} = await useServerTranslation(lng, "root") return (
diff --git a/todoblue/src/app/[lang]/(page)/KnownBoardsPanel.tsx b/todoblue/src/app/[lang]/(page)/KnownBoardsPanel.tsx index 110dd26..119eded 100644 --- a/todoblue/src/app/[lang]/(page)/KnownBoardsPanel.tsx +++ b/todoblue/src/app/[lang]/(page)/KnownBoardsPanel.tsx @@ -1,6 +1,6 @@ "use client"; -import {useTranslation} from "@/app/(i18n)/client" +import {useClientTranslation} from "@/app/(i18n)/client" import {useLowerKebabState} from "@/app/[lang]/useKebabState" import {faKey} from "@fortawesome/free-solid-svg-icons" import cn from "classnames" @@ -10,7 +10,7 @@ import {FontAwesomeIcon} from "@fortawesome/react-fontawesome" export function KnownBoardsPanel({lng}: {lng: string}) { - const {t} = useTranslation(lng, "root") + const {t} = useClientTranslation(lng, "root") const [code, setCode] = useLowerKebabState("") const router = useRouter(); diff --git a/todoblue/src/app/[lang]/(page)/RootHeader.tsx b/todoblue/src/app/[lang]/(page)/RootHeader.tsx index e83cd9d..69257ff 100644 --- a/todoblue/src/app/[lang]/(page)/RootHeader.tsx +++ b/todoblue/src/app/[lang]/(page)/RootHeader.tsx @@ -1,10 +1,10 @@ -import {useTranslation} from "@/app/(i18n)/server" +import {useServerTranslation} from "@/app/(i18n)/server" import style from "./RootHeader.module.css" import {default as React} from "react" export async function RootHeader({lng}: {lng: string}) { - const {t} = await useTranslation(lng, "root") + const {t} = await useServerTranslation(lng, "root") return (
diff --git a/todoblue/src/app/[lang]/(page)/StarredBoardsPanel.tsx b/todoblue/src/app/[lang]/(page)/StarredBoardsPanel.tsx index aa8f0b0..ba127ac 100644 --- a/todoblue/src/app/[lang]/(page)/StarredBoardsPanel.tsx +++ b/todoblue/src/app/[lang]/(page)/StarredBoardsPanel.tsx @@ -1,6 +1,6 @@ "use client"; -import {useTranslation} from "@/app/(i18n)/client" +import {useClientTranslation} from "@/app/(i18n)/client" import {useManagedStarred} from "@/app/[lang]/StarContext" import {faStar} from "@fortawesome/free-solid-svg-icons" import {FontAwesomeIcon} from "@fortawesome/react-fontawesome" @@ -10,7 +10,7 @@ import {useEffect, useState} from "react" export function StarredBoardsPanel({lng}: {lng: string}) { - const {t} = useTranslation(lng, "root") + const {t} = useClientTranslation(lng, "root") const [isClient, setIsClient] = useState(null); const {starred} = useManagedStarred()