diff --git a/app/routes/index.tsx b/app/routes/index.tsx index 1efaf18cf..35bae7966 100644 --- a/app/routes/index.tsx +++ b/app/routes/index.tsx @@ -9,7 +9,7 @@ import { Main } from "~/components/Main"; import { db } from "~/db"; import { useIsMounted } from "~/hooks/useIsMounted"; import { mostRecentArticles } from "~/modules/articles"; -import styles from "~/styles/front-page.css"; +import styles from "~/styles/front.css"; import { databaseTimestampToDate } from "~/utils/dates"; import { discordFullName } from "~/utils/strings"; import { @@ -38,29 +38,31 @@ export const loader = async () => { }; export default function Index() { + const { t } = useTranslation(["common", "front"]); + return (
- See all the past and upcoming events on the calendar page + {t("front:calendarGoTo")}
-

More features

+

{t("front:moreFeatures")}

@@ -70,10 +72,12 @@ export default function Index() { } function Header() { + const { t } = useTranslation("front"); + return (

sendou.ink

-

Competitive Splatoon Hub

+

{t("websiteSubtitle")}

); } @@ -105,12 +109,12 @@ function GoToPageBanner({ function CalendarPeek() { const data = useLoaderData(); - const { i18n } = useTranslation(); + const { t, i18n } = useTranslation("front"); return (
-

Recent winners

+

{t("recentWinners")}

{data.recentWinners.map((result) => (
-

Upcoming events

+

{t("upcomingEvents")}

{data.upcomingEvents.map((event) => ( (); return ( @@ -202,7 +207,8 @@ function ArticlesPeek() {
  • {article.title}
    - by {article.author} • + {t("articleBy", { author: article.author })} •{" "} +
  • ))} diff --git a/app/styles/front-page.css b/app/styles/front.css similarity index 100% rename from app/styles/front-page.css rename to app/styles/front.css diff --git a/public/locales/en/front.json b/public/locales/en/front.json new file mode 100644 index 000000000..152fe17d6 --- /dev/null +++ b/public/locales/en/front.json @@ -0,0 +1,10 @@ +{ + "websiteSubtitle": "Competitive Splatoon Hub", + "calendarGoTo": "See all the past and upcoming events on the calendar page", + "moreFeatures": "More features", + "plus.description": "View Plus Server voting history and more", + "badges.description": "List of all the badges you can earn for your profile", + "recentWinners": "Recent winners", + "upcomingEvents": "Upcoming events", + "articleBy": "by {{author}}" +} diff --git a/types/react-i18next.d.ts b/types/react-i18next.d.ts index 4aa885a21..d870c1973 100644 --- a/types/react-i18next.d.ts +++ b/types/react-i18next.d.ts @@ -1,6 +1,7 @@ import "react-i18next"; import type common from "../public/locales/en/common.json"; +import type front from "../public/locales/en/front.json"; import type faq from "../public/locales/en/faq.json"; import type contributions from "../public/locales/en/contributions.json"; import type user from "../public/locales/en/user.json"; @@ -12,6 +13,7 @@ declare module "react-i18next" { defaultNS: "common"; resources: { common: typeof common; + front: typeof front; faq: typeof faq; contributions: typeof contributions; user: typeof user;