fix(i18n): use English runtime text and localize system UI

This commit is contained in:
Arthur Koba
2026-10-25 19:44:15 +03:00
parent ada0550571
commit 65a96670d5
289 changed files with 8092 additions and 3426 deletions
@@ -4,8 +4,10 @@ import { useQuery } from '@tanstack/react-query';
import { useEffect } from 'react';
import { ConfigService } from '@/lib/services/config';
import { usePathname } from 'next/navigation';
import { useTranslations } from 'next-intl';
export function SiteTitleUpdater() {
const t = useTranslations('providers.titleUpdater');
const pathname = usePathname();
const publicConfigQuery = useQuery({
queryKey: ['public-config'],
@@ -18,17 +20,17 @@ export function SiteTitleUpdater() {
// Determine the page suffix based on path
let suffix = '';
if (pathname === '/login') {
suffix = ' - 登录';
suffix = ` - ${t('login')}`;
} else if (pathname === '/register') {
suffix = ' - 注册';
suffix = ` - ${t('register')}`;
} else if (pathname.startsWith('/admin')) {
suffix = ' - 后台管理';
suffix = ` - ${t('admin')}`;
} else if (pathname === '/') {
suffix = ' - 总览';
suffix = ` - ${t('dashboard')}`;
}
document.title = `${siteName}${suffix}`;
}, [publicConfigQuery.data?.site_name, pathname]);
}, [publicConfigQuery.data?.site_name, pathname, t]);
return null;
}