diff --git a/website/public/locales/en/common.json b/website/public/locales/en/common.json index 99edf6c3..d18e5d91 100644 --- a/website/public/locales/en/common.json +++ b/website/public/locales/en/common.json @@ -1,6 +1,7 @@ { "about": "About", "account_settings": "Account", + "admin_dashboard": "Admin Dashboard", "connect": "Connect", "conversational": "Conversational AI for everyone.", "dashboard": "Dashboard", diff --git a/website/src/components/Faq.tsx b/website/src/components/Faq.tsx index 55bb3585..46d5d19c 100644 --- a/website/src/components/Faq.tsx +++ b/website/src/components/Faq.tsx @@ -27,10 +27,10 @@ export function Faq() { return ( - {t(`faq_items.q${index}`)} + {t(`faq_items.q${index as 0}`)} - {t(`faq_items.a${index}`)} + {t(`faq_items.a${index as 0}`)} ); diff --git a/website/src/components/Header/UserMenu.tsx b/website/src/components/Header/UserMenu.tsx index bc2a377e..8b5de035 100644 --- a/website/src/components/Header/UserMenu.tsx +++ b/website/src/components/Header/UserMenu.tsx @@ -20,7 +20,6 @@ import React, { ElementType, useCallback } from "react"; interface MenuOption { name: string; href: string; - desc: string; icon: ElementType; isExternal: boolean; } @@ -40,21 +39,18 @@ export function UserMenu() { { name: t("dashboard"), href: "/dashboard", - desc: t("dashboard"), icon: Layout, isExternal: false, }, { name: t("account_settings"), href: "/account", - desc: t("account_settings"), icon: Settings, isExternal: false, }, { name: t("report_a_bug"), href: "https://github.com/LAION-AI/Open-Assistant/issues/new/choose", - desc: t("report_a_bug"), icon: AlertTriangle, isExternal: true, }, @@ -64,7 +60,6 @@ export function UserMenu() { options.unshift({ name: t("admin_dashboard"), href: "/admin", - desc: t("admin_dashboard"), icon: Shield, isExternal: false, }); diff --git a/website/src/pages/dashboard.tsx b/website/src/pages/dashboard.tsx index 2c5bea5e..32774f4a 100644 --- a/website/src/pages/dashboard.tsx +++ b/website/src/pages/dashboard.tsx @@ -1,7 +1,7 @@ import { Flex } from "@chakra-ui/react"; import Head from "next/head"; +import { useTranslation } from "next-i18next"; import { useEffect, useMemo, useState } from "react"; -import { useTranslation } from "react-i18next"; import { LeaderboardTable, TaskOption, WelcomeCard } from "src/components/Dashboard"; import { getDashboardLayout } from "src/components/Layout"; import { TaskCategory } from "src/components/Tasks/TaskTypes"; diff --git a/website/src/pages/index.tsx b/website/src/pages/index.tsx index 888c0d61..6ac7dd38 100644 --- a/website/src/pages/index.tsx +++ b/website/src/pages/index.tsx @@ -24,7 +24,7 @@ const Home = () => { <> {t("title")} - + diff --git a/website/src/pages/leaderboard.tsx b/website/src/pages/leaderboard.tsx index e413366f..7bb8e025 100644 --- a/website/src/pages/leaderboard.tsx +++ b/website/src/pages/leaderboard.tsx @@ -11,19 +11,19 @@ const Leaderboard = () => { return ( <> - {`${t("leaderboard")} - ${t("common:title")}`} + {`${t("leaderboard:leaderboard")} - ${t("common:title")}`} - {t("leaderboard")} + {t("leaderboard:leaderboard")} - {t("daily")} - {t("weekly")} - {t("monthly")} - {t("overall")} + {t("leaderboard:daily")} + {t("leaderboard:weekly")} + {t("leaderboard:monthly")} + {t("leaderboard:overall")} diff --git a/website/types/i18next.d.ts b/website/types/i18next.d.ts new file mode 100644 index 00000000..9c447c2c --- /dev/null +++ b/website/types/i18next.d.ts @@ -0,0 +1,15 @@ +import "i18next"; + +import type common from "../public/locales/en/common.json"; +import type index from "../public/locales/en/index.json"; +import type leaderboard from "../public/locales/en/leaderboard.json"; + +declare module "i18next" { + interface CustomTypeOptions { + resources: { + common: typeof common; + index: typeof index; + leaderboard: typeof leaderboard; + }; + } +}