refactor: more i18n

This commit is contained in:
Tristan Yang
2022-11-30 19:49:08 +08:00
parent 51ca2d52fa
commit 92dfe51d30
4 changed files with 19 additions and 10 deletions
+6 -1
View File
@@ -27,6 +27,11 @@
"enter": "Enter", "enter": "Enter",
"last_tip": "Now lets invite others!", "last_tip": "Now lets invite others!",
"last_desc": "Send invitation link to your future community members:", "last_desc": "Send invitation link to your future community members:",
"done": "Done" "done": "Done",
"welcome_page": "Welcome Page",
"set_name": "Set Name",
"admin_account": "Admin Account",
"who_sign_up": "Who Can Sign Up",
"invites": "Invites"
} }
} }
+6 -1
View File
@@ -27,6 +27,11 @@
"enter": "进入", "enter": "进入",
"last_tip": "现在,你可以邀请别人啦!", "last_tip": "现在,你可以邀请别人啦!",
"last_desc": "将邀请链接发送给将来要入驻的社区成员吧:", "last_desc": "将邀请链接发送给将来要入驻的社区成员吧:",
"done": "完成" "done": "完成",
"welcome_page": "欢迎",
"set_name": "设置名称",
"admin_account": "管理员账号",
"who_sign_up": "注册权限",
"invites": "邀请"
} }
} }
@@ -9,7 +9,6 @@ import ContextMenu, { Item } from "../../../common/component/ContextMenu";
import useUserOperation from "../../../common/hook/useUserOperation"; import useUserOperation from "../../../common/hook/useUserOperation";
import { useAppSelector } from "../../../app/store"; import { useAppSelector } from "../../../app/store";
import { useTranslation } from "react-i18next"; import { useTranslation } from "react-i18next";
import { t } from "i18next";
type Props = { type Props = {
context: "user" | "channel"; context: "user" | "channel";
id: number; id: number;
+7 -7
View File
@@ -1,6 +1,6 @@
import { useCallback, useState } from "react"; import { useCallback, useState } from "react";
import { Swiper } from "swiper/types"; import { Swiper } from "swiper/types";
import { t } from 'i18next';
// `name` for in-code usage, `label` for display // `name` for in-code usage, `label` for display
export interface Step { export interface Step {
name: string; name: string;
@@ -11,28 +11,28 @@ export interface Step {
const steps: Step[] = [ const steps: Step[] = [
{ {
name: "welcomePage", name: "welcomePage",
label: "Welcome Page" label: t("welcome:onboarding.welcome_page")
}, },
{ {
name: "serverName", name: "serverName",
label: "Set Name" label: t("welcome:onboarding.set_name")
}, },
{ {
name: "adminAccount", name: "adminAccount",
label: "Admin Account" label: t("welcome:onboarding.admin_account")
}, },
{ {
name: "whoCanSignUp", name: "whoCanSignUp",
label: "Who Can Sign Up" label: t("welcome:onboarding.who_sign_up")
}, },
{ {
name: "inviteLink", name: "inviteLink",
label: "Invites", label: t("welcome:onboarding.invites"),
canJumpTo: ["whoCanSignUp"] canJumpTo: ["whoCanSignUp"]
}, },
{ {
name: "donePage", name: "donePage",
label: "Done", label: t("welcome:onboarding.done"),
canJumpTo: ["whoCanSignUp", "inviteLink"] canJumpTo: ["whoCanSignUp", "inviteLink"]
} }
]; ];