feat: Add i18n support for Chinese language (#142)

* feat: Add i18n support for Chinese language

* fix: locale not working in Docker environment
This commit is contained in:
Jungley
2023-03-25 23:42:48 +08:00
committed by GitHub
parent 932853f1ba
commit 92eab6c634
26 changed files with 320 additions and 40 deletions
+5 -2
View File
@@ -1,5 +1,6 @@
import { IconCheck, IconTrash, IconX } from "@tabler/icons-react";
import { FC, useState } from "react";
import { useTranslation } from "next-i18next";
import { SidebarButton } from "./SidebarButton";
interface Props {
@@ -9,6 +10,8 @@ interface Props {
export const ClearConversations: FC<Props> = ({ onClearConversations }) => {
const [isConfirming, setIsConfirming] = useState<boolean>(false);
const { t } = useTranslation('sidebar')
const handleClearConversations = () => {
onClearConversations();
setIsConfirming(false);
@@ -18,7 +21,7 @@ export const ClearConversations: FC<Props> = ({ onClearConversations }) => {
<div className="flex hover:bg-[#343541] py-3 px-3 rounded-md cursor-pointer w-full items-center">
<IconTrash size={16} />
<div className="ml-3 flex-1 text-left text-white">Are you sure?</div>
<div className="ml-3 flex-1 text-left text-white">{t('Are you sure?')}</div>
<div className="flex w-[40px]">
<IconCheck
@@ -42,7 +45,7 @@ export const ClearConversations: FC<Props> = ({ onClearConversations }) => {
</div>
) : (
<SidebarButton
text="Clear conversations"
text={t("Clear conversations")}
icon={<IconTrash size={16} />}
onClick={() => setIsConfirming(true)}
/>