Skip to content

feat(i18n): add internationalization support with English and Portugu…#23

Draft
RafaelLimaC wants to merge 17 commits intomainfrom
issue-14
Draft

feat(i18n): add internationalization support with English and Portugu…#23
RafaelLimaC wants to merge 17 commits intomainfrom
issue-14

Conversation

@RafaelLimaC
Copy link
Contributor

closes #14

feat(Header): implement Header component with navigation and routing
chore: update package dependencies for i18next and react-i18next

Issue ticket number and link

Describe your changes

Visual

Collum 1 Collum 2
Cell Cell

Checklist before requesting a review

  • I have performed a self-review of my code
  • If it is a core feature, i have added thorough tests.
  • If it is a component, i have made a new story for this.

@RafaelLimaC RafaelLimaC requested a review from Copilot April 10, 2025 18:01
Copy link

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.

Copilot reviewed 6 out of 9 changed files in this pull request and generated 1 comment.

Files not reviewed (3)
  • package.json: Language not supported
  • src/i18n/locales/en-us.json: Language not supported
  • src/i18n/locales/pt-br.json: Language not supported
Comments suppressed due to low confidence (1)

src/components/Header/Header.tsx:27

  • Direct use of the global 'location' object may cause issues in certain environments. Consider using the 'useLocation' hook from react-router for improved integration and reliability.
location.pathname === nav.redirect || location.hash === nav.redirect

Copy link

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.

Copilot reviewed 6 out of 9 changed files in this pull request and generated 1 comment.

Files not reviewed (3)
  • package.json: Language not supported
  • src/i18n/locales/en-us.json: Language not supported
  • src/i18n/locales/pt-br.json: Language not supported
Comments suppressed due to low confidence (1)

src/components/Header/Header.tsx:8

  • [nitpick] Consider renaming the interface from 'NavItems' to 'NavItem' to better represent a single navigation item.
interface NavItems {

@RafaelLimaC RafaelLimaC requested a review from Copilot April 10, 2025 19:15
Copy link

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.

Copilot reviewed 6 out of 9 changed files in this pull request and generated no comments.

Files not reviewed (3)
  • package.json: Language not supported
  • src/i18n/locales/en-us.json: Language not supported
  • src/i18n/locales/pt-br.json: Language not supported
Comments suppressed due to low confidence (1)

src/components/Header/Header.tsx:8

  • [nitpick] Consider renaming the interface 'NavItems' to 'NavItem' since it represents a single navigation item rather than a collection.
interface NavItems {

@RafaelLimaC RafaelLimaC requested a review from Frompaje April 10, 2025 20:44
@RafaelLimaC RafaelLimaC requested a review from Copilot April 11, 2025 13:31
Copy link

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.

Copilot reviewed 6 out of 9 changed files in this pull request and generated no comments.

Files not reviewed (3)
  • package.json: Language not supported
  • src/i18n/locales/en-us.json: Language not supported
  • src/i18n/locales/pt-br.json: Language not supported
Comments suppressed due to low confidence (1)

src/components/Header/Header.tsx:32

  • Initializing the active navigation state only on component mount may cause inconsistencies if the route changes without a click event. Consider deriving the active state directly from router.pathname or using a useEffect hook to update the state when the route changes.
const [activeItem, setActiveItem] = useState(() => getActiveNavItem(navItems, router.pathname));

Copy link

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.

Copilot reviewed 9 out of 12 changed files in this pull request and generated no comments.

Files not reviewed (3)
  • package.json: Language not supported
  • src/i18n/locales/en-us.json: Language not supported
  • src/i18n/locales/pt-br.json: Language not supported
Comments suppressed due to low confidence (1)

src/i18n/index.ts:26

  • Directly accessing localStorage and navigator may cause runtime errors in non-browser environments. Consider adding a check to ensure these are available before usage.
lng: localStorage.getItem('@i18n') || getSupportedLocale(navigator.language),

@RafaelLimaC RafaelLimaC requested a review from Copilot April 12, 2025 18:19
Copy link

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.

Copilot reviewed 9 out of 12 changed files in this pull request and generated 1 comment.

Files not reviewed (3)
  • package.json: Language not supported
  • src/i18n/locales/en-us.json: Language not supported
  • src/i18n/locales/pt-br.json: Language not supported

Copy link

@Frompaje Frompaje left a comment

Choose a reason for hiding this comment

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

@RafaelLimaC RafaelLimaC reopened this Apr 14, 2025
@RafaelLimaC
Copy link
Contributor Author

i18n implementado seguindo o exemplo do next:
https://github.com/vercel/next.js/tree/canary/examples/i18n-routing

@RafaelLimaC RafaelLimaC marked this pull request as draft April 20, 2025 22:03
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.

Header

6 participants