fix(auth): translation of sign in page (#4624)

This commit is contained in:
YANG QIA 2024-06-11 23:37:00 +08:00 committed by GitHub
parent 454079b510
commit 4e8bbf884c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -14,6 +14,7 @@ import { useCurrentDocumentTitle, usePlugin, useViewport } from '@nocobase/clien
import AuthPlugin, { AuthOptions } from '..';
import { Authenticator, AuthenticatorsContext } from '../authenticator';
import { useAuthTranslation } from '../locale';
import { Schema } from '@formily/react';
export const useSignInForms = (): {
[authType: string]: AuthOptions['components']['SignInForm'];
@ -63,7 +64,10 @@ export const SignInPage = () => {
if (!C) {
return;
}
const defaultTabTitle = `${t('Sign-in')} (${t(authenticator.authTypeTitle || authenticator.authType)})`;
const defaultTabTitle = `${t('Sign-in')} (${Schema.compile(
authenticator.authTypeTitle || authenticator.authType,
{ t },
)})`;
return {
component: createElement<{
authenticator: Authenticator;