mirror of
https://github.com/Rain-kl/OpenFlare.git
synced 2026-10-14 02:46:37 +08:00
feat(frontend): 控制台 next-intl 中英双语
接入无 URL 前缀的 zh-CN/en,顶栏与外观设置可切换语言;选择写入 cookie 后刷新生效。
This commit is contained in:
@@ -7,9 +7,12 @@ import {
|
||||
waitFor,
|
||||
} from '@testing-library/react';
|
||||
import { AxiosError, type AxiosResponse } from 'axios';
|
||||
import { NextIntlClientProvider } from 'next-intl';
|
||||
import { beforeEach, expect, it, vi } from 'vitest';
|
||||
|
||||
import type { WAFRule, WAFRuleGraph } from '@/lib/services';
|
||||
import mainZh from '@/messages/zh-CN.json';
|
||||
import securityZh from '@/messages/fragments/security.zh-CN.json';
|
||||
|
||||
import WAFRuleEditorPage from './page';
|
||||
|
||||
@@ -105,9 +108,15 @@ function renderPage() {
|
||||
defaultOptions: { queries: { retry: false }, mutations: { retry: false } },
|
||||
});
|
||||
return render(
|
||||
<QueryClientProvider client={client}>
|
||||
<WAFRuleEditorPage />
|
||||
</QueryClientProvider>,
|
||||
<NextIntlClientProvider
|
||||
locale='zh-CN'
|
||||
messages={{ ...mainZh, ...securityZh }}
|
||||
timeZone='Asia/Shanghai'
|
||||
>
|
||||
<QueryClientProvider client={client}>
|
||||
<WAFRuleEditorPage />
|
||||
</QueryClientProvider>
|
||||
</NextIntlClientProvider>,
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user