Skip to content

feat(apollo-vertex): add language switcher [AGVSOL-1055, AGVSOL-1045]#133

Merged
alincadariu merged 1 commit intomainfrom
alincadariu/language-switcher
Feb 4, 2026
Merged

feat(apollo-vertex): add language switcher [AGVSOL-1055, AGVSOL-1045]#133
alincadariu merged 1 commit intomainfrom
alincadariu/language-switcher

Conversation

@alincadariu
Copy link
Contributor

@alincadariu alincadariu commented Jan 28, 2026

The goal: consumer would only need to provide the translation files.

This PR adds:

  • Locale provider
  • type safety for translation keys
  • i18n initialization
  • language switcher
Screenshot 2026-01-28 at 15 25 13

@github-actions
Copy link

github-actions bot commented Jan 28, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (PT)
apollo-canvas 🟢 Ready Preview, Logs Feb 04, 2026, 03:11:32 AM
apollo-ui-react 🟢 Ready Preview, Logs Feb 04, 2026, 03:10:28 AM
apollo-vertex 🟢 Ready Preview, Logs Feb 04, 2026, 03:09:52 AM
apollo-wind 🟢 Ready Preview, Logs Feb 04, 2026, 03:09:29 AM

@github-actions
Copy link

github-actions bot commented Jan 28, 2026

🤖 AI Code Review (Claude)

⚠️ Automated Review: This is an AI-generated review. Use as guidance, not gospel.

Code Review: Add Language Switcher to Apollo Vertex Shell

Summary

This PR adds a language toggle component to the Apollo Vertex shell, allowing users to switch between 13 supported languages. The component is integrated into the sidebar (both collapsed and expanded states) and dispatches custom events for i18n integration.

Code Quality ✅

The implementation is clean and well-structured:

  • ✅ Component properly separated into language-toggle.tsx
  • ✅ Props threading through shell layers is correct
  • ✅ Good documentation with usage examples in MDX
  • ✅ Proper handling of both sidebar states (collapsed/expanded)

Minor observation (non-blocking): The setLanguage callback has an empty dependency array but should include any dependencies if the component is used in different contexts. Current implementation is acceptable for this use case.

Security ✅

No security concerns identified:

  • ✅ No XSS vulnerabilities - locale codes and names are from trusted configuration
  • ✅ Custom event dispatch is safe - only dispatches locale code (string)
  • ✅ No external data or user input being processed unsafely

Type Safety ✅

TypeScript usage is appropriate:

  • ✅ Proper interface definitions for LanguageToggleProps and ApolloShellProps
  • ✅ Props correctly typed through component chain
  • ✅ Event handling could be more strongly typed but is acceptable

Suggestion (non-blocking): Consider creating a typed event interface:

export interface LanguageChangedEvent extends CustomEvent {
  detail: { selectedLanguageId: string };
}

Testing ⚠️

As per project guidelines, tests are not required for playground apps (apps/ folder). This is acceptable.

Performance ✅

No performance concerns:

  • useCallback appropriately used for event dispatch
  • ✅ Component is lightweight (dropdown with 13 items)
  • ✅ Local state management is simple and efficient

Additional Notes

Positive aspects:

  1. Comprehensive language support (13 locales including regional variants)
  2. Accessible design with sr-only label
  3. Visual feedback for selected language (bg-accent)
  4. Good integration pattern with i18n systems via custom events
  5. Documentation includes practical integration example

Minor observations (non-blocking):

  1. The next-env.d.ts change (.next/types/routes.d.ts.next/dev/types/routes.d.ts) appears to be an auto-generated Next.js internal change - this is fine
  2. Consider persisting the selected language (e.g., localStorage) in future iterations for better UX

Recommendation: APPROVE

This PR is well-implemented, secure, and ready to merge. The language switcher component follows good patterns, integrates cleanly with the existing shell, and provides a solid foundation for i18n support. The code quality is high and appropriate for a playground/showcase application.


This automated review is temporary for solo development. Will be replaced with human reviews once the team grows.

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

✅ AI Review: Changes look good. Auto-approved by Claude AI.

@alincadariu alincadariu force-pushed the alincadariu/language-switcher branch from 3de304d to 7aa9208 Compare January 28, 2026 14:14
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

⚠️ AI Review: Please review the concerns raised above before merging.

@alincadariu alincadariu force-pushed the alincadariu/language-switcher branch from 7aa9208 to 1c532a9 Compare January 28, 2026 14:24
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

⚠️ AI Review: Please review the concerns raised above before merging.

@alincadariu alincadariu force-pushed the alincadariu/language-switcher branch from 1c532a9 to 47a6c07 Compare January 28, 2026 14:27
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

⚠️ AI Review: Please review the concerns raised above before merging.

@alincadariu alincadariu force-pushed the alincadariu/language-switcher branch from 47a6c07 to 844bc4b Compare January 28, 2026 14:29
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

⚠️ AI Review: Please review the concerns raised above before merging.

@alincadariu alincadariu force-pushed the alincadariu/language-switcher branch from 844bc4b to 7731397 Compare January 28, 2026 14:33
@alincadariu alincadariu changed the title feat: add language switcher to apollo-vertex shell feat(apollo-vertex): add language switcher to apollo-vertex shell Jan 28, 2026
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

⚠️ AI Review: Please review the concerns raised above before merging.

@alincadariu alincadariu force-pushed the alincadariu/language-switcher branch 2 times, most recently from 2fa9af6 to cd32a34 Compare January 28, 2026 14:35
@alincadariu alincadariu marked this pull request as ready for review January 28, 2026 14:35
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

✅ AI Review: Changes look good. Auto-approved by Claude AI.

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

✅ AI Review: Changes look good. Auto-approved by Claude AI.

@alincadariu alincadariu changed the title feat(apollo-vertex): add language switcher to apollo-vertex shell feat(apollo-vertex): add language switcher to apollo-vertex shell [AGVSOL-1055] Jan 28, 2026
@alincadariu alincadariu changed the title feat(apollo-vertex): add language switcher to apollo-vertex shell [AGVSOL-1055] feat(apollo-vertex): add language switcher[AGVSOL-1055] Jan 28, 2026
@alincadariu alincadariu force-pushed the alincadariu/language-switcher branch 2 times, most recently from 0386ca5 to 4c170e6 Compare February 3, 2026 13:07
@alincadariu alincadariu force-pushed the alincadariu/language-switcher branch 3 times, most recently from d3e331b to 9496242 Compare February 3, 2026 13:44
@alincadariu alincadariu changed the title feat(apollo-vertex): add language switcher[AGVSOL-1055] feat(apollo-vertex): add language switcher [AGVSOL-1055] Feb 3, 2026
@alincadariu alincadariu force-pushed the alincadariu/language-switcher branch 8 times, most recently from b137ac1 to 700b433 Compare February 3, 2026 16:37
@alincadariu alincadariu force-pushed the alincadariu/language-switcher branch from 700b433 to 3624dfc Compare February 4, 2026 11:07
@alincadariu alincadariu changed the title feat(apollo-vertex): add language switcher [AGVSOL-1055] feat(apollo-vertex): add language switcher [AGVSOL-1055, AGVSOL-1045] Feb 4, 2026
@alincadariu alincadariu merged commit cecbd26 into main Feb 4, 2026
22 of 25 checks passed
@alincadariu alincadariu deleted the alincadariu/language-switcher branch February 4, 2026 13:33
@CalinaCristian
Copy link
Collaborator

Current Stack

  • main

Managed with stacked-prs

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.

5 participants