Skip to content

Conversation

@iamsohilvahora
Copy link

Description

This PR adds a global route middleware to handle unsupported two-letter language
paths (e.g. /cn) by redirecting users to the English version of the requested
page.

When a redirect occurs, a banner is displayed to inform users that translations
are not available for the requested language code.


Changes

  • Redirect unsupported two-letter locale paths to English
  • Preserve the remainder of the URL path during redirect
  • Store the unsupported locale in a cookie
  • Display a dismissible banner explaining the redirect
  • Implemented using Nuxt global middleware (SSR-safe)

Testing

  • Visited /cn → redirected to / with banner displayed
  • Visited /cn/search?q=test → redirected to /search?q=test
  • Verified banner dismiss behavior
  • Confirmed no console or SSR errors

Screenshots

@iamsohilvahora iamsohilvahora requested a review from a team as a code owner January 7, 2026 14:36
@openverse-bot openverse-bot added 🧱 stack: frontend Related to the Nuxt frontend 🚦 status: awaiting triage Has not been triaged & therefore, not ready for work labels Jan 7, 2026
@openverse-bot openverse-bot moved this to 👀 Needs Review in Openverse PRs Jan 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🧱 stack: frontend Related to the Nuxt frontend 🚦 status: awaiting triage Has not been triaged & therefore, not ready for work

Projects

Status: 👀 Needs Review

Development

Successfully merging this pull request may close these issues.

2 participants