Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Redirect Spanish routes on JustFix.nyc to the English version. #1498

Merged
merged 2 commits into from
May 28, 2020

Conversation

toolness
Copy link
Collaborator

@toolness toolness commented May 28, 2020

Fixes #1463.

NoRent.org is localized but JustFix.nyc isn't; our server's locale negotiation logic doesn't know this, so it might send the user to the Spanish version of JustFix.nyc (e.g., from / to /es/), and if that happens we want to redirect the user to the English version, since the Spanish version of JustFix.nyc isn't ready yet.

We're just doing this on the client-side for now because we don't really know what our localization strategy will be for JustFix.nyc: one idea that's been floated is to actually localize our offerings product-by-product, e.g. localizing EHPA before LOC, which would mean we'd need to granualize this redirection based on knowledge of client-side routes, so the client-side seems the best place to put this logic for now.

@toolness toolness requested a review from sraby May 28, 2020 11:40
@toolness toolness mentioned this pull request May 28, 2020
33 tasks
Comment on lines +9 to +13
export function createLocaleRedirectorRoute(
from: LocaleChoice,
to: LocaleChoice
): JSX.Element {
const fromPath = `/${from}/`;
Copy link
Member

Choose a reason for hiding this comment

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

Noice! This is super clear and unambiguous as to what this function is doing :)

Copy link
Member

@sraby sraby left a comment

Choose a reason for hiding this comment

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

Great! So the idea is that we can just plop this function in a route object for, say, the Rent history tool-- so that all Spanish routes to the RH tool will redirect back to English until we have it translated?

@toolness
Copy link
Collaborator Author

Yup yup!!! For now it'll redirect everything on JustFix.nyc but in the future we can change it so it supports certain routes, etc.

@toolness toolness merged commit bb63273 into master May 28, 2020
@toolness toolness deleted the justfix-locale-redirector branch May 28, 2020 13:41
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.

Figure out how to enable l10n for norent but not justfix
2 participants