From e2fe3cd998a4de3876b918a0d384ac65b99dade0 Mon Sep 17 00:00:00 2001 From: yudejp Date: Mon, 14 Jun 2021 12:48:30 +0900 Subject: [PATCH] Change the way to inject translations --- pages/index.js | 27 ++++++++------------------- 1 file changed, 8 insertions(+), 19 deletions(-) diff --git a/pages/index.js b/pages/index.js index 4613ff3..a6b4b98 100644 --- a/pages/index.js +++ b/pages/index.js @@ -8,23 +8,12 @@ import useTranslation from 'next-translate/useTranslation' import { useRouter } from 'next/router' export default function Index(props) { - - // Translation const router = useRouter() const { locale, locales, defaultLocale, pathname } = router const { t, lang } = useTranslation("index") - const home = t('home') - const profile = t('profile') - const blog = t('blog') - const status = t('status') - const house = t('house') - const discord = t('discord') - const mastodon = t('mastodon') - const minecraft = t('minecraft:title') return ( - - +
-
{profile}
-
{blog}
-
{status}
-
{house}
+
{t('profile')}
+
{t('blog')}
+
{t('status')}
+
{t('house')}
Scrapbox
-
{discord}
+
{t('discord')}
GitHub Organization
Gitea
-
{mastodon}
-
{minecraft} + +
{t('minecraft:title')}