mirror of
https://gitee.com/nocobase/nocobase.git
synced 2025-05-05 13:39:24 +08:00
fix(l10n): localization for fields of sign up page (#6556)
This commit is contained in:
parent
f43ed88eba
commit
27c2538d40
@ -8,7 +8,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { SchemaComponent } from '@nocobase/client';
|
import { SchemaComponent } from '@nocobase/client';
|
||||||
import { ISchema } from '@formily/react';
|
import { ISchema, Schema } from '@formily/react';
|
||||||
import React, { useMemo } from 'react';
|
import React, { useMemo } from 'react';
|
||||||
import { uid } from '@formily/shared';
|
import { uid } from '@formily/shared';
|
||||||
import { useAuthTranslation } from '../locale';
|
import { useAuthTranslation } from '../locale';
|
||||||
@ -122,6 +122,7 @@ const getSignupPageSchema = (fieldSchemas: any): ISchema => ({
|
|||||||
|
|
||||||
export const SignUpForm = ({ authenticatorName: name }: { authenticatorName: string }) => {
|
export const SignUpForm = ({ authenticatorName: name }: { authenticatorName: string }) => {
|
||||||
const { t } = useAuthTranslation();
|
const { t } = useAuthTranslation();
|
||||||
|
const { t: fieldT } = useTranslation('lm-collections');
|
||||||
const useBasicSignUp = () => {
|
const useBasicSignUp = () => {
|
||||||
return useSignUp({ authenticator: name });
|
return useSignUp({ authenticator: name });
|
||||||
};
|
};
|
||||||
@ -132,8 +133,12 @@ export const SignUpForm = ({ authenticatorName: name }: { authenticatorName: str
|
|||||||
return signupForm
|
return signupForm
|
||||||
.filter((field: { show: boolean }) => field.show)
|
.filter((field: { show: boolean }) => field.show)
|
||||||
.reduce((prev: any, item: { field: string; required: boolean; uiSchema: any }) => {
|
.reduce((prev: any, item: { field: string; required: boolean; uiSchema: any }) => {
|
||||||
prev[item.field] = {
|
const uiSchema = {
|
||||||
...item.uiSchema,
|
...item.uiSchema,
|
||||||
|
title: item.uiSchema.title ? fieldT(Schema.compile(item.uiSchema.title, { t })) : '',
|
||||||
|
};
|
||||||
|
prev[item.field] = {
|
||||||
|
...uiSchema,
|
||||||
required: item.required,
|
required: item.required,
|
||||||
'x-decorator': 'FormItem',
|
'x-decorator': 'FormItem',
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user