Skip to content

Make all components with English text functional client components #414

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

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

danielhjacobs
Copy link
Collaborator

This unlocks client-side translations (#358) and will be necessary whether we use next-export-i18n or custom translation code. I feel like no one wants to accept #358 yet, but doing this first can make the commits there a lot cleaner.

@danielhjacobs danielhjacobs force-pushed the make-all-pages-client branch 4 times, most recently from 6d496a9 to 8e00524 Compare May 7, 2025 16:41
@danielhjacobs danielhjacobs force-pushed the make-all-pages-client branch from 8e00524 to f8dcb10 Compare May 28, 2025 15:38
@danielhjacobs danielhjacobs requested a review from kjarosh May 30, 2025 20:23
@danielhjacobs
Copy link
Collaborator Author

Why this will be needed:

Assuming we want to keep serving the website client-side, the website language needs to be checked client-side in order to apply translations. That means changing the language needs to, in some way, be done by JavaScript. next-export-i18n has two ways to do that: check the window.location.search or window.localStorage, and as window is only available client-side, either way it will only work on client components. Therefore, every component with English text (including the header and footer) needs to be a client component.

@danielhjacobs
Copy link
Collaborator Author

For a draft with translations that build upon this, see danielhjacobs#4

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.

1 participant