From 07ee55d8d9a9551d1de3da5836436673433d4ba2 Mon Sep 17 00:00:00 2001 From: kunish Date: Sat, 2 Sep 2023 00:32:27 +0800 Subject: [PATCH] feat(i18n): setup page i18n support --- src/i18n/index.tsx | 2 ++ src/pages/Setup.tsx | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/i18n/index.tsx b/src/i18n/index.tsx index 7ee78d3..acead76 100644 --- a/src/i18n/index.tsx +++ b/src/i18n/index.tsx @@ -4,6 +4,7 @@ import { ParentComponent, createEffect, createSignal } from 'solid-js' const dict = { 'en-US': { + add: 'Add', overview: 'Overview', proxies: 'Proxies', rules: 'Rules', @@ -37,6 +38,7 @@ const dict = { close: 'Close', }, 'zh-Hans': { + add: '添加', overview: '概览', proxies: '代理', rules: '规则', diff --git a/src/pages/Setup.tsx b/src/pages/Setup.tsx index c71ebdb..08883cd 100644 --- a/src/pages/Setup.tsx +++ b/src/pages/Setup.tsx @@ -1,5 +1,6 @@ import { createForm } from '@felte/solid' import { validator } from '@felte/validator-zod' +import { useI18n } from '@solid-primitives/i18n' import { useNavigate } from '@solidjs/router' import { IconX } from '@tabler/icons-solidjs' import ky from 'ky' @@ -14,6 +15,7 @@ const schema = z.object({ }) export default () => { + const [t] = useI18n() const navigate = useNavigate() const onSetupSuccess = (id: string) => { @@ -102,7 +104,7 @@ export default () => { />