fix(l10n): i18n namespace of page title (#4557)

This commit is contained in:
YANG QIA 2024-06-05 15:38:16 +08:00 committed by GitHub
parent ec15f9e35a
commit af1325f055
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -11,7 +11,7 @@ import { css } from '@emotion/css';
import { useSessionStorageState } from 'ahooks';
import { App, ConfigProvider, Divider, Layout } from 'antd';
import { createGlobalStyle } from 'antd-style';
import React, { createContext, useContext, useEffect, useMemo, useRef, useState } from 'react';
import React, { createContext, useCallback, useContext, useEffect, useMemo, useRef, useState } from 'react';
import { Link, Outlet, useLocation, useMatch, useNavigate, useParams } from 'react-router-dom';
import {
ACLRolesCheckProvider,
@ -37,6 +37,7 @@ import { Plugin } from '../../../application/Plugin';
import { useAppSpin } from '../../../application/hooks/useAppSpin';
import { Help } from '../../../user/Help';
import { VariablesProvider } from '../../../variables';
import { useMenuTranslation } from '../../../schema-component/antd/menu/locale';
const filterByACL = (schema, options) => {
const { allowAll, allowMenuItemIds = [] } = options;
@ -76,7 +77,9 @@ const useMenuProps = () => {
const MenuEditor = (props) => {
const { notification } = App.useApp();
const [hasNotice, setHasNotice] = useSessionStorageState('plugin-notice', { defaultValue: false });
const { setTitle } = useDocumentTitle();
const { t } = useMenuTranslation();
const { setTitle: _setTitle } = useDocumentTitle();
const setTitle = useCallback((title) => _setTitle(t(title)), []);
const navigate = useNavigate();
const params = useParams<any>();
const location = useLocation();