feat: support i18n namespace

This commit is contained in:
ReaJason
2025-08-13 23:53:40 +08:00
parent a5f6411444
commit 3f5a2ddb6b
41 changed files with 987 additions and 663 deletions
@@ -12,8 +12,11 @@ import { UrlPatternFormField } from "./urlpattern-field";
export function NeoRegTabContent({
form,
shellTypes,
}: Readonly<{ form: UseFormReturn<MemShellFormSchema>; shellTypes: Array<string> }>) {
const { t } = useTranslation();
}: Readonly<{
form: UseFormReturn<MemShellFormSchema>;
shellTypes: Array<string>;
}>) {
const { t } = useTranslation(["memshell", "common"]);
return (
<FormProvider {...form}>
<TabsContent value="NeoreGeorg">
@@ -29,8 +32,11 @@ export function NeoRegTabContent({
name="headerName"
render={({ field }) => (
<FormFieldItem>
<FormFieldLabel>{t("shellToolConfig.headerName")}</FormFieldLabel>
<Input {...field} placeholder={t("placeholders.input")} />
<FormFieldLabel>{t("common:headerName")}</FormFieldLabel>
<Input
{...field}
placeholder={t("common:placeholders.input")}
/>
</FormFieldItem>
)}
/>
@@ -40,9 +46,12 @@ export function NeoRegTabContent({
render={({ field }) => (
<FormFieldItem>
<FormFieldLabel>
{t("shellToolConfig.headerValue")} {t("optional")}
{t("common:headerValue")} {t("common:optional")}
</FormFieldLabel>
<Input {...field} placeholder={t("placeholders.input")} />
<Input
{...field}
placeholder={t("common:placeholders.input")}
/>
</FormFieldItem>
)}
/>