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

@@ -145,8 +145,8 @@ describe('ProxyHosts - Coverage enhancements', () => {
const user = userEvent.setup()
const selectAllBtn = screen.getByLabelText('Select all rows')
await user.click(selectAllBtn)
// Wait for selection UI to appear - text format includes "<strong>2</strong> hosts selected (all)"
await waitFor(() => expect(screen.getByText(/hosts?\s*selected/)).toBeTruthy())
// Wait for selection UI to appear - text format includes "<strong>2</strong> host(s) selected (all)"
await waitFor(() => expect(screen.getByText(/host\(s\) selected/)).toBeTruthy())
// Also check for "(all)" indicator
expect(screen.getByText(/\(all\)/)).toBeTruthy()
// Click again to deselect
@@ -432,8 +432,8 @@ describe('ProxyHosts - Coverage enhancements', () => {
await waitFor(() => expect(screen.getByText('S1')).toBeTruthy())
const headerCheckbox = screen.getByLabelText('Select all rows')
await userEvent.click(headerCheckbox)
// Wait for selection bar to appear and find the delete button
await waitFor(() => expect(screen.getByText(/hosts?\s*selected/)).toBeTruthy())
// Wait for selection bar to appear and find the delete button - text format is "host(s) selected"
await waitFor(() => expect(screen.getByText(/host\(s\) selected/)).toBeTruthy())
// Click the bulk Delete button (with bg-error class) - there are multiple Delete buttons, get the one in selection bar
const deleteButtons = screen.getAllByRole('button', { name: /Delete/ })
// The bulk delete button has bg-error class