-
Notifications
You must be signed in to change notification settings - Fork 58
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
base: master
Are you sure you want to change the base?
Make all components with English text functional client components #414
Conversation
6d496a9
to
8e00524
Compare
8e00524
to
f8dcb10
Compare
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. |
For a draft with translations that build upon this, see danielhjacobs#4 |
Since the current website was mostly your work originally, do you think you could spare some minutes to review this, @Dinnerbone? Only if your time and energy allows it, of course! |
Of note is there's something, previously discussed on Discord, that should probably be done to improve the performance of this, specifically when it comes to the compatibility and AVM2 compatibility pages. Namely, the avm2-report should be copied to the website's static files folder (https://github.com/ruffle-rs/ruffle-rs.github.io/tree/master/public) in a pre-build step, instead of using the new fetch-report route. The two places with Edit: Done |
532a4c9
to
1ad0707
Compare
1ad0707
to
dc19b3d
Compare
I can't build this 🤔 Does it change our node version requirement or something else?
Edit: Updating to node 22 worked :D |
Weird, I'm on Node 20.19.0 and it worked fine. I can switch to import modules but I thought |
Switched to ESM, it works but resulted in this error:
|
I'm fine with keeping it 22+ only, the method you had was okay, was just surprised. No need to support anything older than "current LTS" for website, I think. |
Regarding the PR itself: I'm a little concerned about making everything client only though, that just increases load times and makes it harder for tools to scrape us. Is it truly necessary? |
We want to translate, and I know you've previously expressed a possible desire to host the website not on GitHub pages, but most of the other people who've weighted in say they wouldn't want to move off of GitHub pages just for this. GitHub pages uses a static website, which is why we use In general, translations on a static site will have to use either the path, the query string, or, my preferred version, localStorage. |
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.