From 28c8bf0e0d4b8e8789b28d7824e9dd37b95640fb Mon Sep 17 00:00:00 2001 From: Redon <790348264@qq.com> Date: Tue, 28 Mar 2023 16:36:30 +0800 Subject: [PATCH] chore: update chinese locales (#247) * chore: update chinese locales * chore: update locales --- components/Promptbar/PromptModal.tsx | 24 +++++++++++++++--------- components/Promptbar/Promptbar.tsx | 2 +- pages/index.tsx | 5 +++-- public/locales/zh/chat.json | 7 +++++-- public/locales/zh/promptbar.json | 12 ++++++++++++ public/locales/zh/sidebar.json | 2 +- 6 files changed, 37 insertions(+), 15 deletions(-) create mode 100644 public/locales/zh/promptbar.json diff --git a/components/Promptbar/PromptModal.tsx b/components/Promptbar/PromptModal.tsx index 722c4def8e..8223c07ec7 100644 --- a/components/Promptbar/PromptModal.tsx +++ b/components/Promptbar/PromptModal.tsx @@ -1,5 +1,6 @@ import { Prompt } from '@/types/prompt'; import { FC, KeyboardEvent, useEffect, useRef, useState } from 'react'; +import { useTranslation } from 'next-i18next'; interface Props { prompt: Prompt; @@ -8,6 +9,7 @@ interface Props { } export const PromptModal: FC = ({ prompt, onClose, onUpdatePrompt }) => { + const { t } = useTranslation('promptbar'); const [name, setName] = useState(prompt.name); const [description, setDescription] = useState(prompt.description); const [content, setContent] = useState(prompt.content); @@ -42,11 +44,11 @@ export const PromptModal: FC = ({ prompt, onClose, onUpdatePrompt }) => { return (
-
+