From c72fa7fcac2f1424125b196d5be845f7448f507d Mon Sep 17 00:00:00 2001 From: DIYgod Date: Sun, 26 Feb 2023 16:02:20 +0000 Subject: [PATCH] fix: ja language support --- next-i18next.config.js | 2 +- src/hooks/useDate.ts | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/next-i18next.config.js b/next-i18next.config.js index a733b6a9..0b64ac2c 100644 --- a/next-i18next.config.js +++ b/next-i18next.config.js @@ -1,7 +1,7 @@ module.exports = { i18n: { defaultLocale: "en", - locales: ["en", "zh"], + locales: ["en", "zh", "ja"], reloadOnPrerender: process.env.NODE_ENV === "development", }, } diff --git a/src/hooks/useDate.ts b/src/hooks/useDate.ts index 7fc0e7e8..4ae3608a 100644 --- a/src/hooks/useDate.ts +++ b/src/hooks/useDate.ts @@ -6,8 +6,9 @@ import localizedFormat from "dayjs/plugin/localizedFormat" import duration from "dayjs/plugin/duration" import relativeTime from "dayjs/plugin/relativeTime" import { useTranslation } from "next-i18next" -import "dayjs/locale/zh" import "dayjs/locale/en" +import "dayjs/locale/zh" +import "dayjs/locale/ja" dayjs.extend(localizedFormat) dayjs.extend(utc)