WordPress / openverse

Openverse is a search engine for openly-licensed media. This monorepo includes all application code.
https://openverse.org
MIT License
254 stars 203 forks source link

Unsupported language codes redirect to 404 #575

Open sarayourfriend opened 2 years ago

sarayourfriend commented 2 years ago

Description

Originally reported by @AetherUnbound

Example: https://openverse.org/cn

Additional context

We should redirect to English with a banner saying we don't have translations for the requested language code.

This should be handled in a middleware that sets a cookie for rendering the banner after redirecting to the English version of the page. Redirect any two-letter paths that do not match the available locales. To find the available locales, check the i18n.availableLocales string array (retrieve i18n using the useI18n composable).

Resolution

fcoveram commented 1 year ago

Not sure if this needs design work, the redirect can be immediate once landing.

sarayourfriend commented 1 year ago

I've removed the design needed label and updated the issue description with a concrete solution :+1: