mirror of
https://gitee.com/nocobase/nocobase.git
synced 2025-05-05 05:29:26 +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 { ISchema } from '@formily/react';
|
||||
import { ISchema, Schema } from '@formily/react';
|
||||
import React, { useMemo } from 'react';
|
||||
import { uid } from '@formily/shared';
|
||||
import { useAuthTranslation } from '../locale';
|
||||
@ -122,6 +122,7 @@ const getSignupPageSchema = (fieldSchemas: any): ISchema => ({
|
||||
|
||||
export const SignUpForm = ({ authenticatorName: name }: { authenticatorName: string }) => {
|
||||
const { t } = useAuthTranslation();
|
||||
const { t: fieldT } = useTranslation('lm-collections');
|
||||
const useBasicSignUp = () => {
|
||||
return useSignUp({ authenticator: name });
|
||||
};
|
||||
@ -132,8 +133,12 @@ export const SignUpForm = ({ authenticatorName: name }: { authenticatorName: str
|
||||
return signupForm
|
||||
.filter((field: { show: boolean }) => field.show)
|
||||
.reduce((prev: any, item: { field: string; required: boolean; uiSchema: any }) => {
|
||||
prev[item.field] = {
|
||||
const uiSchema = {
|
||||
...item.uiSchema,
|
||||
title: item.uiSchema.title ? fieldT(Schema.compile(item.uiSchema.title, { t })) : '',
|
||||
};
|
||||
prev[item.field] = {
|
||||
...uiSchema,
|
||||
required: item.required,
|
||||
'x-decorator': 'FormItem',
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user