Skip to content

Conversation

@adamrefaey
Copy link
Collaborator

Change

Refactor translation hooks and update i18n resources for improved localization support

Does this PR introduce a breaking change?

{...}

What needs to be documented once your changes are merged?

{...}

Additional Comments

{...}

@adamrefaey adamrefaey requested review from GuidoBR and Copilot May 2, 2025 19:51
@adamrefaey adamrefaey self-assigned this May 2, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR refactors translation hooks and updates the i18n resource usage while also adjusting bookmark toggling logic and caching in report-related hooks. Key changes include:

  • Updating translation hooks to use specific namespaces in ActionButtons, TabNavigation, and ReportItem.
  • Changing bookmark toggling logic to invert the current bookmark status in multiple report list pages.
  • Introducing a constant (LATEST_REPORTS_LIMIT) for consistent report caching in the useReports hook.

Reviewed Changes

Copilot reviewed 6 out of 10 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
frontend/src/pages/Reports/components/ActionButtons.tsx Added namespaced translation usage.
frontend/src/pages/Reports/ReportsListPage.tsx Updated bookmark toggling to use the inverse of the current state.
frontend/src/pages/Home/components/ReportItem/ReportItem.tsx Removed the ‘report’ namespace from useTranslation while still referencing it in translation calls.
frontend/src/pages/Home/HomePage.tsx Updated bookmark toggling logic similar to other pages.
frontend/src/common/hooks/useReports.ts Introduced and used LATEST_REPORTS_LIMIT in queries and cache updates.
frontend/src/common/components/Router/TabNavigation.tsx Revised translation hook usage and removed defaultValue in alt text calls.
Files not reviewed (4)
  • frontend/src/common/utils/i18n/resources/en/common.json: Language not supported
  • frontend/src/common/utils/i18n/resources/en/reportDetail.json: Language not supported
  • frontend/src/common/utils/i18n/resources/fr/common.json: Language not supported
  • frontend/src/common/utils/i18n/resources/fr/reportDetail.json: Language not supported

@adamrefaey adamrefaey merged commit 15cd198 into main May 2, 2025
1 check passed
@adamrefaey adamrefaey deleted the ADE-215 branch May 2, 2025 19:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants