-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Fallback page for missing translations #6
Comments
Great question! This is a super interesting challenge that we're exploring in some of our work at the moment. It raises some interesting technical and UX considerations. One approach might be to leverage server config or redirects, depending on your infrastructure. Here's one approach to explore. Given it's a static site though, would a user find it strange to be switched automatically back and forth between languages? I.e. The main layout (i.e. header nav) would be in English as you "fall back" from the missing Also, one might consider a Keen to hear any other thoughts you might have. I'll let you know how we approached it when we land on an approach 👍 |
Hey Adam! Thanks for sharing your thoughts on this. I like the prebuild approach a lot, and will look into it if I get some time. That feels more inline with the static site setup, not depending on server to make it all work. I imagine the "generated" fallback language pages would go into the site dist folder, so they could stay out of version control. We could even inject a notice on the page that the translated content is missing. It's also interesting how the files are structured in the Apache approach you shared. I really like that you could have all the translated files in the same directory, and not need to replicate the site folder structure for each language. |
In Internationalization And Localization For Static Sites @Snugug proposed an approach using Service Worker and intercept the request (plus, redirects to a fallback page if necessary). |
Yes! lots of good ideas in that article, also helpful to see the source code here: and here: |
Sorry to butt in here but the new upcoming |
Looking for a way to have missing translations fall back to English until they are added.
Take this structure for example:
Spanish is missing the about page. Is there a way to have that page fall back to the English version, so visiting example.com/es-ES/about would render the English about page?
The text was updated successfully, but these errors were encountered: