chore: update i18n locales

This commit is contained in:
Steven
2023-09-05 22:10:23 +08:00
parent 126e4a62f8
commit 7348f47ef8
9 changed files with 35 additions and 18 deletions

View File

@ -3,6 +3,7 @@ import axios from "axios";
import copy from "copy-to-clipboard";
import { useEffect, useState } from "react";
import { toast } from "react-hot-toast";
import { useTranslation } from "react-i18next";
import { ListUserAccessTokensResponse, UserAccessToken } from "@/types/proto/api/v2/user_service_pb";
import useUserStore from "../../stores/v1/user";
import { showCommonDialog } from "../Alert";
@ -15,6 +16,7 @@ const listAccessTokens = async (userId: number) => {
};
const AccessTokenSection = () => {
const { t } = useTranslation();
const currentUser = useUserStore().getCurrentUser();
const [userAccessTokens, setUserAccessTokens] = useState<UserAccessToken[]>([]);
const [showCreateDialog, setShowCreateDialog] = useState<boolean>(false);
@ -68,7 +70,7 @@ const AccessTokenSection = () => {
setShowCreateDialog(true);
}}
>
Create
{t("common.create")}
</Button>
</div>
</div>
@ -91,7 +93,7 @@ const AccessTokenSection = () => {
Expires At
</th>
<th scope="col" className="relative py-3.5 pl-3 pr-4">
<span className="sr-only">Delete</span>
<span className="sr-only">{t("common.delete")}</span>
</th>
</tr>
</thead>

View File

@ -1,10 +1,12 @@
import { Button } from "@mui/joy";
import { useState } from "react";
import { useTranslation } from "react-i18next";
import useUserStore from "../../stores/v1/user";
import ChangePasswordDialog from "../ChangePasswordDialog";
import EditUserinfoDialog from "../EditUserinfoDialog";
const AccountSection: React.FC = () => {
const { t } = useTranslation();
const currentUser = useUserStore().getCurrentUser();
const [showEditUserinfoDialog, setShowEditUserinfoDialog] = useState<boolean>(false);
const [showChangePasswordDialog, setShowChangePasswordDialog] = useState<boolean>(false);
@ -19,12 +21,12 @@ const AccountSection: React.FC = () => {
{isAdmin && <span className="ml-2 bg-blue-600 text-white px-2 leading-6 text-sm rounded-full">Admin</span>}
</p>
<p className="flex flex-row justify-start items-center">
<span className="mr-3 text-gray-500">Email: </span>
<span className="mr-3 text-gray-500">{t("common.email")}: </span>
{currentUser.email}
</p>
<div className="flex flex-row justify-start items-center gap-2 mt-2">
<Button variant="outlined" color="neutral" onClick={() => setShowEditUserinfoDialog(true)}>
Edit
{t("common.edit")}
</Button>
<Button variant="outlined" color="neutral" onClick={() => setShowChangePasswordDialog(true)}>
Change password