fix(i18n): 统一使用 useLazyTranslation 避免翻译 key 闪烁

This commit is contained in:
雨霖铃
2026-05-21 00:50:01 +08:00
parent 604fbb4d1f
commit 8e2ac5200d
19 changed files with 70 additions and 34 deletions
+2 -2
View File
@@ -1,6 +1,6 @@
import { Box, Switch, Typography } from '@mui/material';
import { storageCleanerPageStyles } from '@/config/pageTheme';
import { useTranslation } from 'react-i18next';
import { useLazyTranslation } from '@/utils/useLazyTranslation';
interface AutoRefreshToggleProps {
autoRefresh: boolean;
@@ -8,7 +8,7 @@ interface AutoRefreshToggleProps {
}
export default function AutoRefreshToggle({ autoRefresh, onChange }: AutoRefreshToggleProps) {
const { t } = useTranslation(['storageCleaner']);
const { t } = useLazyTranslation('storageCleaner');
return (
<Box sx={storageCleanerPageStyles.AUTO_REFRESH_CONTAINER}>
<Typography variant="body2" fontWeight={700} sx={{ fontSize: '0.8rem', px: 1.2 }}>