fix(i18n): translations

- Added translation support using react-i18next in WafConfig and CrowdSecConfig components.
- Updated UI elements to use translation keys instead of hardcoded strings.
- Enhanced test coverage for i18n integration, including mocks for translation in tests.
- Fixed various test cases to align with new translation structure.
- Created a QA report for i18n implementation, noting validation of translation files and areas for improvement.
This commit is contained in:
GitHub Actions
2025-12-19 05:35:02 +00:00
parent 03518145c0
commit 8511d98160
48 changed files with 9038 additions and 1772 deletions

View File

@@ -127,13 +127,13 @@ describe('CrowdSecConfig coverage', () => {
vi.mocked(securityApi.getSecurityStatus).mockRejectedValue(new Error('boom'))
renderWithQueryClient(<CrowdSecConfig />)
expect(await screen.findByText(/Failed to load security status/)).toBeInTheDocument()
expect(await screen.findByText(/Error loading CrowdSec status/)).toBeInTheDocument()
})
it('handles missing status and missing crowdsec sections', async () => {
vi.mocked(securityApi.getSecurityStatus).mockRejectedValueOnce(new Error('data is undefined'))
renderWithQueryClient(<CrowdSecConfig />)
expect(await screen.findByText(/Failed to load security status/)).toBeInTheDocument()
expect(await screen.findByText(/Error loading CrowdSec status/)).toBeInTheDocument()
cleanup()
@@ -152,7 +152,7 @@ describe('CrowdSecConfig coverage', () => {
it('shows info banner directing to Security Dashboard', async () => {
await renderPage()
expect(screen.getByText(/CrowdSec is controlled via the toggle on the/i)).toBeInTheDocument()
expect(screen.getByRole('link', { name: /Security Dashboard/i })).toHaveAttribute('href', '/security')
expect(screen.getByRole('link', { name: /Security/i })).toHaveAttribute('href', '/security')
})
it('guards import without a file and shows error on import failure', async () => {